diff --git a/GROUPS.md b/GROUPS.md index 0aba2c7da..c65b2eb46 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -71,6 +71,7 @@ Please read to learn how digging times * `coral_block=X`: Coral block (1 = alive, 2 = dead) * `coral_species=X`: Specifies the species of a coral; equal X means equal species * `set_on_fire=X`: Sets any (not fire-resistant) mob or player on fire for X seconds when touching +* `compostability`: Amount from 1 to 100 that defines the percentage of likelyhood that the composter will advance a level. #### Footnotes diff --git a/mods/CORE/mcl_mapgen/init.lua b/mods/CORE/mcl_mapgen/init.lua index 4aca65f54..fc0a98c6b 100644 --- a/mods/CORE/mcl_mapgen/init.lua +++ b/mods/CORE/mcl_mapgen/init.lua @@ -325,7 +325,7 @@ minetest.register_on_generated(function(minp, maxp, chunkseed) -- mcl_mapgen.register_mapgen_lvm(function(vm_context), order_number) -- -- -- for _, v in pairs(queue_chunks_lvm) do - vm_context = v.f(vm_context) + v.f(vm_context) end -- -- -- mcl_mapgen.register_mapgen(function(minp, maxp, chunkseed, vm_context), order_number) -- diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 90e44cedc..c899b5148 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -417,6 +417,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason) -- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage) if luaentity.health > 0 then luaentity.health = luaentity.health - damage + luaentity.pause_timer = 0.4 end return end diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index eb366013e..d31913599 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -152,3 +152,23 @@ minetest.register_globalstep(function(dtime) dimtimer = 0 end end) + +function mcl_worlds.get_cloud_parameters() + if mcl_mapgen.name == "valleys" then + return { + height = 384, + speed = {x=-2, z=0}, + thickness=5, + color="#FFF0FEF", + ambient = "#201060", + } + else + -- MC-style clouds: Layer 127, thickness 4, fly to the “West” + return { + height = mcl_worlds.layer_to_y(127), + speed = {x=-2, z=0}, + thickness = 4, + color = "#FFF0FEF", + } + end +end diff --git a/mods/ENTITIES/extra_mobs/dolphin.lua b/mods/ENTITIES/extra_mobs/dolphin.lua index 11cafff70..7d4ee7d2e 100644 --- a/mods/ENTITIES/extra_mobs/dolphin.lua +++ b/mods/ENTITIES/extra_mobs/dolphin.lua @@ -246,4 +246,4 @@ water-16, water) --spawn egg -mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) +mobs:register_egg("extra_mobs:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr b/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr new file mode 100644 index 000000000..87caf9592 --- /dev/null +++ b/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr @@ -0,0 +1,17 @@ +# textdomain:extra_mobs +Hoglin=Hoglin +piglin=Piglin +piglin Brute=Piglin Barbare +Strider=Arpenteur +Fox=Renard +Cod=Poisson +Salmon=Saumon +dolphin=Dauphin +Glow Squid=Pieuvre Lumineuse +Glow Ink Sac=Sac d'Encre Lumineuse +Use it to craft the Glow Item Frame.=Utilisez le pour fabriquer le Cadre à Objet Lumineux +Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.=Utiliser le Sac d'Encre Lumineuse et le Cadre à Objet normal pour fabriquer le Cadre à Objet Lumineux. +Glow Item Frame=Cadre à Objet Lumineux +Can hold an item and glows=Peut exposer un objet et éclairer +Glow Item frames are decorative blocks in which items can be placed.=les Cadres à Objet Lumineux sont des blocs décoratifs pouvant contenir des objets. +Just place any item on the item frame. Use the item frame again to retrieve the item.=Placer n'importe quel objet sur le cadre. Récupérer l'objet en faisant un clic droit sur le cadre. \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/piglin.lua b/mods/ENTITIES/extra_mobs/piglin.lua index 35fa8a2f4..60eb7fb32 100644 --- a/mods/ENTITIES/extra_mobs/piglin.lua +++ b/mods/ENTITIES/extra_mobs/piglin.lua @@ -296,5 +296,5 @@ minetest.LIGHT_MAX+1, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) -- spawn eggs -mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0) -mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) +mobs:register_egg("extra_mobs:piglin", S("Piglin"), "extra_mobs_spawn_icon_piglin.png", 0) +mobs:register_egg("extra_mobs:piglin_brute", S("Piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 3a26c1b36..c848a858e 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -166,11 +166,13 @@ function boat.on_activate(self, staticdata, dtime_s) self._last_v = self._v self._itemstring = data.itemstring - while #data.textures < 5 do - table.insert(data.textures, data.textures[1]) - end + if data.textures then + while #data.textures < 5 do + table.insert(data.textures, data.textures[1]) + end - self.object:set_properties({textures = data.textures}) + self.object:set_properties({textures = data.textures}) + end end end diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr index 91be07c32..922f5f069 100644 --- a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr +++ b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr @@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou Dark Oak Boat=Bateau en Chêne Noir Jungle Boat=Bateau en Acajou Oak Boat=Bateau en Chêne +Obsidian Boat=Bateau en Obsidienne Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet. Spruce Boat=Bateau en Sapin Water vehicle=Véhicule aquatique diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 183456309..254d25f36 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -65,6 +65,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 diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index 2d8cef5b0..6c61855aa 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -227,6 +227,11 @@ functions needed for the mob to work properly which contains the following: older mobs. 'pushable' Allows players, & other mobs to push the mob. + 'spawn_with_armor' If set to true, the mob has a small chance of spawning with + random matched armor. If set to a string, the string represents + the material type of the armor. Any materials used by + mcl_armor will work. Example: "gold" + It is assumed that the first texture is for armor. MineClone 2 extensions: diff --git a/mods/ENTITIES/mcl_mobs/api/api.lua b/mods/ENTITIES/mcl_mobs/api/api.lua index c72dca0bd..4447c1587 100644 --- a/mods/ENTITIES/mcl_mobs/api/api.lua +++ b/mods/ENTITIES/mcl_mobs/api/api.lua @@ -375,6 +375,7 @@ function mobs:register_mob(name, def) --moves the wrong way swap_y_with_x = def.swap_y_with_x or false, reverse_head_yaw = def.reverse_head_yaw or false, + _spawn_with_armor = def.spawn_with_armor, --END HEAD CODE VARIABLES @@ -401,6 +402,7 @@ function mobs:register_mob(name, def) ignited_by_sunlight = def.ignited_by_sunlight or false, eye_height = def.eye_height or 1.5, defuse_reach = def.defuse_reach or 4, + spawn = def.spawn, -- End of MCL2 extensions on_spawn = def.on_spawn, diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua index d9cc4237c..971750293 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua @@ -13,8 +13,13 @@ mobs.can_despawn = function(self) if self.tamed or self.bred or self.nametag then return false end local mob_pos = self.object:get_pos() if not mob_pos then return true end + local players = minetest_get_connected_players() + if #players == 0 then return false end + -- If no players, probably this is being called from get_staticdata() at server shutdown time + -- Minetest is to buggy (as of 5.5) to delete entities at server shutdown time anyway + local distance = 999 - for _, player in pairs(minetest_get_connected_players()) do + for _, player in pairs(players) do if player and player:get_hp() > 0 then local player_pos = player:get_pos() local new_distance = vector_distance(player_pos, mob_pos) @@ -62,6 +67,102 @@ mobs.mob_staticdata = function(self) return minetest.serialize(tmp) end +mobs.armor_setup = function(self) + if not self._armor_items then + local armor = {} + -- Source: https://minecraft.fandom.com/wiki/Zombie + local materials = { + {name = "leather", chance = 0.3706}, + {name = "gold", chance = 0.4873}, + {name = "chain", chance = 0.129}, + {name = "iron", chance = 0.0127}, + {name = "diamond", chance = 0.0004} + } + local types = { + {name = "helmet", chance = 0.15}, + {name = "chestplate", chance = 0.75}, + {name = "leggings", chance = 0.75}, + {name = "boots", chance = 0.75} + } + + local material + if type(self._spawn_with_armor) == "string" then + material = self._spawn_with_armor + else + local chance = 0 + for i, m in pairs(materials) do + chance = chance + m.chance + if math.random() <= chance then + material = m.name + break + end + end + end + + for i, t in pairs(types) do + if math.random() <= t.chance then + armor[t.name] = material + else + break + end + end + + -- Save armor items in lua entity + self._armor_items = {} + for atype, material in pairs(armor) do + local item = "mcl_armor:" .. atype .. "_" .. material + self._armor_items[atype] = item + end + + -- Setup armor drops + for atype, material in pairs(armor) do + local wear = math.random(1, 65535) + local item = "mcl_armor:" .. atype .. "_" .. material .. " 1 " .. wear + self.drops = table.copy(self.drops) + table.insert(self.drops, { + name = item, + chance = 1/0.085, -- 8.5% + min = 1, + max = 1, + looting = "rare", + looting_factor = 0.01 / 3, + }) + end + + -- Configure textures + local t = "" + local first_image = true + for atype, material in pairs(armor) do + if not first_image then + t = t .. "^" + end + t = t .. "mcl_armor_" .. atype .. "_" .. material .. ".png" + first_image = false + end + if t ~= "" then + self.base_texture = table.copy(self.base_texture) + self.base_texture[1] = t + end + + -- Configure damage groups based on armor + -- Source: https://minecraft.fandom.com/wiki/Armor#Armor_points + local points = 2 + for atype, material in pairs(armor) do + local item_name = "mcl_armor:" .. atype .. "_" .. material + points = points + minetest.get_item_group(item_name, "mcl_armor_points") + end + local armor_strength = 100 - 4 * points + local armor_groups = self.object:get_armor_groups() + armor_groups.fleshy = armor_strength + self.armor = armor_groups + + -- Helmet protects mob from sun damage + if armor.helmet then + self.ignited_by_sunlight = false + end + end +end + -- activate mob and reload settings mobs.mob_activate = function(self, staticdata, def, dtime) @@ -104,6 +205,11 @@ mobs.mob_activate = function(self, staticdata, def, dtime) self.base_colbox = self.collisionbox self.base_selbox = self.selectionbox end + + -- Setup armor on mobs + if self._spawn_with_armor then + mobs.armor_setup(self) + end -- for current mobs that dont have this set if not self.base_selbox then diff --git a/mods/ENTITIES/mcl_mobs/api/spawning.lua b/mods/ENTITIES/mcl_mobs/api/spawning.lua index 424989426..7fb6983f4 100644 --- a/mods/ENTITIES/mcl_mobs/api/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/api/spawning.lua @@ -267,6 +267,8 @@ function mobs:spawn_setup(def) local day_toggle = def.day_toggle local on_spawn = def.on_spawn local check_position = def.check_position + local group_size_min = def.group_size_min or 1 + local group_size_max = def.group_size_max or 1 -- chance/spawn number override in minetest.conf for registered mob local numbers = minetest.settings:get(name) @@ -300,10 +302,23 @@ function mobs:spawn_setup(def) day_toggle = day_toggle, check_position = check_position, on_spawn = on_spawn, + group_size_min = group_size_min, + group_size_max = group_size_max, } summary_chance = summary_chance + chance end +function mobs.spawn_mob(name, pos) + local def = minetest.registered_entities[name] + if not def then return end + if def.spawn then + return def.spawn(pos) + end + return minetest.add_entity(pos, name) +end + +local spawn_mob = mobs.spawn_mob + function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) -- Do mobs spawn at all? @@ -341,6 +356,8 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh spawn_dictionary[key]["min_height"] = min_height spawn_dictionary[key]["max_height"] = max_height spawn_dictionary[key]["day_toggle"] = day_toggle + spawn_dictionary[key]["group_size_min"] = 1 + spawn_dictionary[key]["group_size_max"] = 3 summary_chance = summary_chance + chance end @@ -442,9 +459,9 @@ if mobs_spawn then and (mob_def.check_position and mob_def.check_position(spawning_position) or true) then --everything is correct, spawn mob - local object = minetest.add_entity(spawning_position, mob_def.name) + local object = spawn_mob(mob_def.name, spawning_position) 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/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 51235a3f9..e63c0d594 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -2,118 +2,27 @@ local S = minetest.get_translator(minetest.get_current_modname()) -local rabbit = { - description = S("Rabbit"), - type = "animal", - spawn_class = "passive", - passive = true, - reach = 1, - rotate = 270, - hp_min = 3, - hp_max = 3, - xp_min = 1, - xp_max = 3, - collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2}, +local mob_name = "mobs_mc:rabbit" - visual = "mesh", - mesh = "mobs_mc_rabbit.b3d", - textures = { +local textures = { {"mobs_mc_rabbit_brown.png"}, {"mobs_mc_rabbit_gold.png"}, {"mobs_mc_rabbit_white.png"}, {"mobs_mc_rabbit_white_splotched.png"}, {"mobs_mc_rabbit_salt.png"}, {"mobs_mc_rabbit_black.png"}, - }, - visual_size = {x=1.5, y=1.5}, - sounds = { - random = "mobs_mc_rabbit_random", - damage = "mobs_mc_rabbit_hurt", - death = "mobs_mc_rabbit_death", - attack = "mobs_mc_rabbit_attack", - eat = "mobs_mc_animal_eat_generic", - distance = 16, - }, - makes_footstep_sound = false, - walk_velocity = 1, - run_velocity = 3.7, - follow_velocity = 1.1, - floats = 1, - runaway = true, - jump = true, - drops = { - {name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1, looting = "common",}, - {name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1, looting = "common",}, - {name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1, looting = "rare", looting_factor = 0.03,}, - }, - fear_height = 4, - animation = { - speed_normal = 25, speed_run = 50, - stand_start = 0, stand_end = 0, - walk_start = 0, walk_end = 20, - run_start = 0, run_end = 20, - }, - -- Follow (yellow) dangelions, carrots and golden carrots - follow = mobs_mc.follow.rabbit, - view_range = 8, - -- Eat carrots and reduce their growth stage by 1 - replace_rate = 10, - replace_what = mobs_mc.replace.rabbit, - on_rightclick = function(self, clicker) - -- Feed, tame protect or capture - if mobs:feed_tame(self, clicker, 1, true, true) then return end - end, - do_custom = function(self) - -- Easter egg: Change texture if rabbit is named “Toast” - if self.nametag == "Toast" and not self._has_toast_texture then - self._original_rabbit_texture = self.base_texture - self.base_texture = { "mobs_mc_rabbit_toast.png" } - self.object:set_properties({ textures = self.base_texture }) - self._has_toast_texture = true - elseif self.nametag ~= "Toast" and self._has_toast_texture then - self.base_texture = self._original_rabbit_texture - self.object:set_properties({ textures = self.base_texture }) - self._has_toast_texture = false - end - end, } -mobs:register_mob("mobs_mc:rabbit", rabbit) +local sounds = { + random = "mobs_mc_rabbit_random", + damage = "mobs_mc_rabbit_hurt", + death = "mobs_mc_rabbit_death", + attack = "mobs_mc_rabbit_attack", + eat = "mobs_mc_animal_eat_generic", + distance = 16, +} --- The killer bunny (Only with spawn egg) -local killer_bunny = table.copy(rabbit) -killer_bunny.description = S("Killer Bunny") -killer_bunny.type = "monster" -killer_bunny.spawn_class = "hostile" -killer_bunny.attack_type = "dogfight" -killer_bunny.specific_attack = { "player", "mobs_mc:wolf", "mobs_mc:dog" } -killer_bunny.damage = 8 -killer_bunny.passive = false --- 8 armor points -killer_bunny.armor = 50 -killer_bunny.textures = { "mobs_mc_rabbit_caerbannog.png" } -killer_bunny.view_range = 16 -killer_bunny.replace_rate = nil -killer_bunny.replace_what = nil -killer_bunny.on_rightclick = nil -killer_bunny.run_velocity = 6 -killer_bunny.do_custom = function(self) - if not self._killer_bunny_nametag_set then - self.nametag = S("The Killer Bunny") - self._killer_bunny_nametag_set = true - end -end - -mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) - --- Mob spawning rules. --- Different skins depending on spawn location <- we'll get to this when the spawning algorithm is fleshed out - -mobs:spawn_specific( -"mobs_mc:rabbit", -"overworld", -"ground", -{ +local biome_list = { "FlowerForest_beach", "Forest_beach", "StoneBeach", @@ -161,73 +70,149 @@ mobs:spawn_specific( "MesaBryce", "JungleEdge", "SavannaM", -}, -9, -minetest.LIGHT_MAX+1, -30, -15000, -8, -mobs_mc.spawn_height.overworld_min, -mobs_mc.spawn_height.overworld_max) - ---[[ -local spawn = { - name = "mobs_mc:rabbit", - neighbors = {"air"}, - chance = 15000, - active_object_count = 10, - min_light = 0, - max_light = minetest.LIGHT_MAX+1, - min_height = mobs_mc.spawn_height.overworld_min, - max_height = mobs_mc.spawn_height.overworld_max, } -local spawn_desert = table.copy(spawn) -spawn_desert.nodes = mobs_mc.spawn.desert -spawn_desert.on_spawn = function(self, pos) - local texture = "mobs_mc_rabbit_gold.png" - self.base_texture = { "mobs_mc_rabbit_gold.png" } - self.object:set_properties({textures = self.base_texture}) -end -mobs:spawn(spawn_desert) - -local spawn_snow = table.copy(spawn) -spawn_snow.nodes = mobs_mc.spawn.snow -spawn_snow.on_spawn = function(self, pos) +local function spawn_rabbit(pos) + local biome_data = minetest.get_biome_data(pos) + local biome_name = biome_data and minetest.get_biome_name(biome_data.biome) or "" + local mob = minetest.add_entity(pos, mob_name) + if not mob then return end + local self = mob:get_luaentity() local texture - local r = math.random(1, 100) - -- 80% white fur - if r <= 80 then - texture = "mobs_mc_rabbit_white.png" - -- 20% black and white fur + if biome_name:find("Desert") then + texture = "mobs_mc_rabbit_gold.png" else - texture = "mobs_mc_rabbit_white_splotched.png" + local r = math.random(1, 100) + if biome_name:find("Ice") or biome_name:find("snow") or biome_name:find("Cold") then + -- 80% white fur + if r <= 80 then + texture = "mobs_mc_rabbit_white.png" + -- 20% black and white fur + else + texture = "mobs_mc_rabbit_white_splotched.png" + end + else + -- 50% brown fur + if r <= 50 then + texture = "mobs_mc_rabbit_brown.png" + -- 40% salt fur + elseif r <= 90 then + texture = "mobs_mc_rabbit_salt.png" + -- 10% black fur + else + texture = "mobs_mc_rabbit_black.png" + end + end end - self.base_texture = { texture } - self.object:set_properties({textures = self.base_texture}) + self.base_texture = {texture} + self.object:set_properties({textures = {texture}}) end -mobs:spawn(spawn_snow) -local spawn_grass = table.copy(spawn) -spawn_grass.nodes = mobs_mc.spawn.grassland -spawn_grass.on_spawn = function(self, pos) - local texture - local r = math.random(1, 100) - -- 50% brown fur - if r <= 50 then - texture = "mobs_mc_rabbit_brown.png" - -- 40% salt fur - elseif r <= 90 then - texture = "mobs_mc_rabbit_salt.png" - -- 10% black fur - else - texture = "mobs_mc_rabbit_black.png" +local function do_custom_rabbit(self) + -- Easter egg: Change texture if rabbit is named “Toast” + if self.nametag == "Toast" and not self._has_toast_texture then + self._original_rabbit_texture = self.base_texture + self.base_texture = { "mobs_mc_rabbit_toast.png" } + self.object:set_properties({ textures = self.base_texture }) + self._has_toast_texture = true + elseif self.nametag ~= "Toast" and self._has_toast_texture then + self.base_texture = self._original_rabbit_texture + self.object:set_properties({ textures = self.base_texture }) + self._has_toast_texture = false end - self.base_texture = { texture } - self.object:set_properties({textures = self.base_texture}) end -mobs:spawn(spawn_grass) -]]-- + +local rabbit = { + description = S("Rabbit"), + type = "animal", + spawn_class = "passive", + passive = true, + reach = 1, + rotate = 270, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2}, + visual = "mesh", + mesh = "mobs_mc_rabbit.b3d", + textures = textures, + visual_size = {x=1.5, y=1.5}, + sounds = sounds, + makes_footstep_sound = false, + walk_velocity = 1, + run_velocity = 3.7, + follow_velocity = 1.1, + floats = 1, + runaway = true, + jump = true, + drops = { + {name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1, looting = "common",}, + {name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1, looting = "common",}, + {name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1, looting = "rare", looting_factor = 0.03,}, + }, + fear_height = 4, + animation = { + speed_normal = 25, speed_run = 50, + stand_start = 0, stand_end = 0, + walk_start = 0, walk_end = 20, + run_start = 0, run_end = 20, + }, + -- Follow (yellow) dangelions, carrots and golden carrots + follow = mobs_mc.follow.rabbit, + view_range = 8, + -- Eat carrots and reduce their growth stage by 1 + replace_rate = 10, + replace_what = mobs_mc.replace.rabbit, + on_rightclick = function(self, clicker) + -- Feed, tame protect or capture + if mobs:feed_tame(self, clicker, 1, true, true) then return end + end, + do_custom = do_custom_rabbit, + spawn = spawn_rabbit +} + +mobs:register_mob(mob_name, rabbit) + +-- The killer bunny (Only with spawn egg) +local killer_bunny = table.copy(rabbit) +killer_bunny.description = S("Killer Bunny") +killer_bunny.type = "monster" +killer_bunny.spawn_class = "hostile" +killer_bunny.attack_type = "dogfight" +killer_bunny.specific_attack = { "player", "mobs_mc:wolf", "mobs_mc:dog" } +killer_bunny.damage = 8 +killer_bunny.passive = false +-- 8 armor points +killer_bunny.armor = 50 +killer_bunny.textures = { "mobs_mc_rabbit_caerbannog.png" } +killer_bunny.view_range = 16 +killer_bunny.replace_rate = nil +killer_bunny.replace_what = nil +killer_bunny.on_rightclick = nil +killer_bunny.run_velocity = 6 +killer_bunny.do_custom = function(self) + if not self._killer_bunny_nametag_set then + self.nametag = S("The Killer Bunny") + self._killer_bunny_nametag_set = true + end +end + +mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) + +-- Mob spawning rules. +-- Different skins depending on spawn location <- we customized spawn function + +mobs:spawn_setup({ + name = mob_name, + min_light = 9, + chance = 1000, + aoc = 8, + biomes = biome_list, + group_size_max = 1, + baby_min = 1, + baby_max = 2, +}) -- Spawn egg mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0) diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 3eb0122a7..7a5682d8f 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -204,6 +204,7 @@ local zombie = { attack_type = "punch", punch_timer_cooloff = 0.5, harmed_by_heal = true, + spawn_with_armor = true, } mobs:register_mob("mobs_mc:zombie", zombie) 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..897f295eb 100644 --- a/mods/ENVIRONMENT/lightning/locale/template.txt +++ b/mods/ENVIRONMENT/lightning/locale/template.txt @@ -1,4 +1,4 @@ # 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/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 207039437..3d8677b07 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -285,7 +285,7 @@ local function initsky(player) end -- MC-style clouds: Layer 127, thickness 4, fly to the “West” - player:set_clouds({height=mcl_worlds.layer_to_y(127), speed={x=-2, z=0}, thickness=4, color="#FFF0FEF"}) + player:set_clouds(mcl_worlds:get_cloud_parameters() or {height=mcl_worlds.layer_to_y(127), speed={x=-2, z=0}, thickness=4, color="#FFF0FEF"}) end minetest.register_on_joinplayer(initsky) diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index c963773d1..b1c59fe54 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -101,6 +101,18 @@ awards.register_achievement("mcl:bookcase", { } }) +awards.register_achievement("mcl:buildIronPickaxe", { + title = S("Isn't It Iron Pick"), + -- TODO: This achievement should support all non-wood pickaxes + 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 +137,24 @@ 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", +}) + +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", +}) + -- 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", { @@ -163,6 +193,12 @@ awards.register_achievement("mcl:buildNetherPortal", { icon = "default_obsidian.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", +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) if non_pc_achievements then diff --git a/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr b/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr index 0896bcf36..fc68322a1 100644 --- a/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr +++ b/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr @@ -10,7 +10,7 @@ Craft a stone pickaxe using sticks and cobblestone.=Fabriquez une pioche en pier Craft a wooden sword using wooden planks and sticks on a crafting table.=Fabriquez une épée en bois à l'aide de planches et de bâtons en bois sur un établi. DIAMONDS!=DIAMANTS! Delicious Fish=Délicieux Poisson -Dispense With This=Dispenser de ça +Dispense With This=Dispensé de ça Eat a cooked porkchop.=Mangez du porc cuit. Eat a cooked rabbit.=Mangez du lapin cuit. Get really desperate and eat rotten flesh.=Soyez vraiment désespéré et mangez de la chair pourrie. @@ -47,3 +47,19 @@ Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Utilis Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Utilisez un établi pour fabriquer une pioche en bois à partir de planches et de bâtons en bois. Use obsidian and a fire starter to construct a Nether portal.=Utilisez de l'obsidienne et un briquet pour construire un portail du Nether. Use wheat to craft a bread.=Utilisez du blé pour fabriquer un pain. +Stone Age=L'Age de Pierre +Mine a stone with new pickaxe.=Miner de la roche avec une nouvelle pioche +Hot Stuff=Chaud Devant ! +Put lava in a bucket.=Remplir un Seau de lave +Ice Bucket Challenge=Le défi du seau d'eau glacée +Obtain an obsidian block.=Obtenir un bloc d'obsidienne +Isn't It Iron Pick=Bonne Pioche ! +Craft a iron pickaxe using sticks and iron.=Fabriquer une pioche de fer avec des batons et du fer +Who is Cutting Onions?=Qui épluche des oignons ? +Pick up a crying obsidian from the floor.=Ramasser une obsidienne pleureuse sur le sol. +Hidden in the Depths=Caché dans les profondeurs +Pick up an Ancient Debris from the floor.=Ramasser un Ancien Débris +Not Quite "Nine" Lives=Presque "neuf" vies +Charge a Respawn Anchor to the maximum.=Charger une Ancre de Réapparition au maximum. +The End?=L'End ? +Or the beginning?\nHint: Enter an end portal.=Ou le commencement ?\nAstuce : Entrer dans un portail de l'End. diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index eccec5225..2cb6b28b4 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -53,3 +53,13 @@ Hot Stuff= Put lava in a bucket.= Ice Bucket Challenge= Obtain an obsidian block.= +Isn't It Iron Pick= +Craft a iron pickaxe using sticks and iron.= +Who is Cutting Onions?= +Pick up a crying obsidian from the floor.= +Hidden in the Depths= +Pick up an Ancient Debris from the floor.= +Not Quite "Nine" Lives= +Charge a Respawn Anchor to the maximum.= +The End?= +Or the beginning?\nHint: Enter an end portal.= diff --git a/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr b/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr index 0644e2596..488af5006 100644 --- a/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr +++ b/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr @@ -5,3 +5,4 @@ Error: Too many parameters!=Erreur: Trop de paramètres! Error: Incorrect value of XP=Erreur: Valeur incorrecte de XP Error: Player not found=Erreur: Joueur introuvable Added @1 XP to @2, total: @3, experience level: @4=Ajout de @1 XP à @2, total: @3, niveau d'expérience: @4 +Bottle o' Enchanting=Fiole d'expérience \ No newline at end of file diff --git a/mods/HUD/mcl_info/init.lua b/mods/HUD/mcl_info/init.lua index 02af53fbc..9cf95b43a 100644 --- a/mods/HUD/mcl_info/init.lua +++ b/mods/HUD/mcl_info/init.lua @@ -89,7 +89,7 @@ minetest.register_chatcommand("debug",{ minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 3)) return end - if dbg == default_dbg then + if dbg == default_debug then player_dbg[name] = nil else player_dbg[name] = dbg diff --git a/mods/HUD/mcl_info/locale/mcl_info.fr.tr b/mods/HUD/mcl_info/locale/mcl_info.fr.tr new file mode 100644 index 000000000..fb6ecbd0d --- /dev/null +++ b/mods/HUD/mcl_info/locale/mcl_info.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_info +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=Réglage du masque de débugage : 0 @= désactiver, 1 @= nom de biome, 2 @= coordonnées, 3 @= tout= +Error! Possible values are integer numbers from @1 to @2=Erreur ! Les valeurs autorisées sont des nombres entiers de @1 à @2 +Debug bit mask set to @1=Masque de débugage réglé à @1 \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr b/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr new file mode 100644 index 000000000..a1f7a075c --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr @@ -0,0 +1,2 @@ +# textdomain: mcl_observers +Bell=Cloche diff --git a/mods/ITEMS/REDSTONE/mcl_target/init.lua b/mods/ITEMS/REDSTONE/mcl_target/init.lua new file mode 100644 index 000000000..268c6ebe3 --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/init.lua @@ -0,0 +1,70 @@ +local S = minetest.get_translator("mcl_target") + +local mod_farming = minetest.get_modpath("mcl_farming") + +mcl_target = {} + +function mcl_target.hit(pos, time) + minetest.set_node(pos, {name="mcl_target:target_on"}) + mesecon.receptor_on(pos, mesecon.rules.alldirs) + + local timer = minetest.get_node_timer(pos) + timer:start(time) +end + +minetest.register_node("mcl_target:target_off", { + description = S("Target"), + _doc_items_longdesc = S("A target is a block that provides a temporary redstone charge when hit by a projectile."), + _doc_items_usagehelp = S("Throw a projectile on the target to activate it."), + tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"}, + groups = {hoey = 1}, + sounds = mcl_sounds.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.1}, + }), + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.alldirs, + }, + }, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + +minetest.register_node("mcl_target:target_on", { + description = S("Target"), + _doc_items_create_entry = false, + tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"}, + groups = {hoey = 1, not_in_creative_inventory = 1}, + drop = "mcl_target:target_off", + sounds = mcl_sounds.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.1}, + }), + on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + if node.name == "mcl_target:target_on" then --has not been dug + minetest.set_node(pos, {name="mcl_target:target_off"}) + mesecon.receptor_off(pos, mesecon.rules.alldirs) + end + end, + mesecons = { + receptor = { + state = mesecon.state.on, + rules = mesecon.rules.alldirs, + }, + }, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + + +if mod_farming then + minetest.register_craft({ + output = "mcl_target:target_off", + recipe = { + {"", "mesecons:redstone", ""}, + {"mesecons:redstone", "mcl_farming:hay_block", "mesecons:redstone"}, + {"", "mesecons:redstone", ""}, + }, + }) +end \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr b/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr new file mode 100644 index 000000000..6c558683d --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_target +Target=Cible +A target is a block that provides a temporary redstone charge when hit by a projectile.=La cible est un bloc qui se comporte comme une source d'énergie temporaire quand elle est frappée par un projectile. +Throw a projectile on the target to activate it.=Lancer un projectile sur la cible pour l'activer. \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt b/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt new file mode 100644 index 000000000..18bc7708c --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_target +Target= +A target is a block that provides a temporary redstone charge when hit by a projectile.= +Throw a projectile on the target to activate it.= \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/mod.conf b/mods/ITEMS/REDSTONE/mcl_target/mod.conf new file mode 100644 index 000000000..16f70ed12 --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/mod.conf @@ -0,0 +1,3 @@ +name = mcl_target +author = AFCMS +depends = mesecons, mcl_sounds \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png new file mode 100644 index 000000000..286f7767e Binary files /dev/null and b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png differ diff --git a/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png new file mode 100644 index 000000000..b55ef3ec8 Binary files /dev/null and b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png differ diff --git a/mods/ITEMS/REDSTONE/mesecons_button/init.lua b/mods/ITEMS/REDSTONE/mesecons_button/init.lua index 2812b2758..b324fcf6d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_button/init.lua @@ -216,6 +216,18 @@ mesecon.register_button( S("A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."), "mesecons_button_push") +mesecon.register_button( + "polished_blackstone", + S("Polished Blackstone Button"), + "mcl_blackstone_polished.png", + "mcl_blackstone:blackstone_polished", + mcl_sounds.node_sound_stone_defaults(), + {material_stone=1,handy=1,pickaxey=1}, + 1, + false, + S("A polished blackstone button is a redstone component made out of polished blackstone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."), + "mesecons_button_push") + local woods = { { "wood", "mcl_core:wood", "default_wood.png", S("Oak Button") }, { "acaciawood", "mcl_core:acaciawood", "default_acacia_wood.png", S("Acacia Button") }, @@ -223,6 +235,8 @@ local woods = { { "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Button") }, { "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Button") }, { "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Button") }, + { "warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Button") }, + { "crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Button") }, } for w=1, #woods do diff --git a/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr b/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr index 96f963b4b..03d78b50d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr +++ b/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr @@ -1,6 +1,7 @@ # textdomain: mesecons_button Use the button to push it.=Utilisez le bouton pour le pousser. Stone Button=Bouton de pierre +Polished Blackstone Button=Bouton de Pierre Noire Polie A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=Un bouton en pierre est un composant Redstone en pierre qui peut être poussé pour fournir de la puissance Redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1 seconde. Oak Button=Bouton en Chêne Acacia Button=Bouton en Acacia @@ -8,6 +9,8 @@ Birch Button=Bouton en Bouleau Dark Oak Button=Bouton en Chêne Noir Spruce Button=Bouton en Sapin Jungle Button=Bouton en Acajou +Warped Hyphae Button=Bouton en Hyphae Tordu +Crimson Hyphae Button=Bouton en Hyphae Ecarlate A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.=Un bouton en bois est un composant de redstone en bois qui peut être poussé pour fournir une puissance de redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1,5 seconde. Les boutons en bois peuvent également être poussés par des flèches. Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé Push duration: @1s=Durée de poussée: @1s diff --git a/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt b/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt index 4c352b878..41d404101 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt +++ b/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt @@ -1,6 +1,7 @@ # textdomain: mesecons_button Use the button to push it.= Stone Button= +Polished Blackstone Button= A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.= Oak Button= Acacia Button= @@ -8,6 +9,8 @@ Birch Button= Dark Oak Button= Spruce Button= Jungle Button= +Warped Hyphae Button= +Crimson Hyphae Button= A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.= Provides redstone power when pushed= Push duration: @1s= diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua index d040c8666..b3d7a4de8 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua @@ -164,6 +164,8 @@ local woods = { { "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Pressure Plate" )}, { "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Pressure Plate") }, { "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Pressure Plate") }, + { "warped_hyphae_wood", "mcl_mushrooom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Pressure Plate")}, + { "crimson_hyphae_wood", "mcl_mushrooom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Pressure Plate")}, } for w=1, #woods do @@ -201,6 +203,19 @@ mesecon.register_pressure_plate( { player = true, mob = true }, S("A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) +mesecon.register_pressure_plate( + "mesecons_pressureplates:pressure_plate_polished_blackstone", + S("Polished Blackstone Pressure Plate"), + {"mcl_blackstone_polished.png"}, + {"mcl_blackstone_polished.png"}, + "default_stone.png", + nil, + {{"mcl_blackstone:blackstone_polished", "mcl_blackstone:blackstone_polished"}}, + mcl_sounds.node_sound_stone_defaults(), + {pickaxey=1, material_stone=1}, + { player = true, mob = true }, + S("A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) + mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_gold", S("Light-Weighted Pressure Plate"), @@ -211,5 +226,18 @@ mesecon.register_pressure_plate( {{"mcl_core:gold_ingot", "mcl_core:gold_ingot"}}, mcl_sounds.node_sound_metal_defaults(), {pickaxey=1}, - { player = true, mob = true }, - S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) + nil, + S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.")) + +mesecon.register_pressure_plate( + "mesecons_pressureplates:pressure_plate_iron", + S("Heavy-Weighted Pressure Plate"), + {"default_steel_block.png"}, + {"default_steel_block.png"}, + "default_steel_block.png", + nil, + {{"mcl_core:iron_ingot", "mcl_core:iron_ingot"}}, + mcl_sounds.node_sound_metal_defaults(), + {pickaxey=1}, + nil, + S("A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.")) diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr index ef145de56..f82d3f552 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr @@ -6,10 +6,18 @@ Birch Pressure Plate=Plaque de pression en Bouleau Dark Oak Pressure Plate=Plaque de pression en Chêne Noir Spruce Pressure Plate=Plaque de pression en Sapin Jungle Pressure Plate=Plaque de pression en Acajou +Warped Hyphae Pressure Plate=Plaque de pression en Hyphae Tordue +Crimson Hyphae Pressure Plate=Plaque de pression en Hyphae Ecarlate A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression en bois est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. Stone Pressure Plate=Plaque de pression en pierre A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre. -Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé +Polished Blackstone Pressure Plate=Plaque de pression en pierre noire polie +A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre noire polie est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre. +Light-Weighted Pressure Plate=Plaque de pression pondérée légère +A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée légère est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. +Heavy-Weighted Pressure Plate=Plaque de pression pondérée lourde +A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée lourde est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. +Provides redstone power when pushed=Fournit une puissance de redstone lorsque poussé Pushable by players, mobs and objects=Poussable par les joueurs, les mobs et les objets Pushable by players and mobs=Poussable par les joueurs et les mobs Pushable by players=Poussable par les joueurs diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt index 96eb3f922..a118f727a 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt @@ -6,9 +6,17 @@ Birch Pressure Plate= Dark Oak Pressure Plate= Spruce Pressure Plate= Jungle Pressure Plate= +Warped Hyphae Pressure Plate= +Crimson Hyphae Pressure Plate= A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= Stone Pressure Plate= A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.= +Polished Blackstone Pressure Plate= +A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.= +Light-Weighted Pressure Plate= +A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= +Heavy-Weighted Pressure Plate= +A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= Provides redstone power when pushed= Pushable by players, mobs and objects= Pushable by players and mobs= diff --git a/mods/ITEMS/mcl_beds/init.lua b/mods/ITEMS/mcl_beds/init.lua index 4c25b5390..b07b591dd 100644 --- a/mods/ITEMS/mcl_beds/init.lua +++ b/mods/ITEMS/mcl_beds/init.lua @@ -4,9 +4,11 @@ mcl_beds.pos = {} mcl_beds.bed_pos = {} local modpath = minetest.get_modpath("mcl_beds") +local S = minetest.get_translator(minetest.get_current_modname()) -- Load files dofile(modpath .. "/functions.lua") dofile(modpath .. "/api.lua") dofile(modpath .. "/beds.lua") +dofile(modpath .. "/respawn_anchor.lua") \ No newline at end of file diff --git a/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr b/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr index d85d48bf1..1c10627e3 100644 --- a/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr +++ b/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr @@ -39,3 +39,4 @@ You're sleeping.=Tu dors. You will fall asleep when all players are in bed.=Vous vous endormirez lorsque tous les joueurs seront au lit. You're in bed.=Tu es au lit. Allows you to sleep=Vous permet de dormir +Respawn Anchor=Ancre de Réapparition \ No newline at end of file diff --git a/mods/ITEMS/mcl_beds/locale/template.txt b/mods/ITEMS/mcl_beds/locale/template.txt index 5525bd91b..69c493880 100644 --- a/mods/ITEMS/mcl_beds/locale/template.txt +++ b/mods/ITEMS/mcl_beds/locale/template.txt @@ -40,3 +40,4 @@ You will fall asleep when all players are in bed.= You will fall asleep when @1% of all players are in bed.= You're in bed.= Allows you to sleep= +Respawn Anchor= diff --git a/mods/ITEMS/mcl_beds/mod.conf b/mods/ITEMS/mcl_beds/mod.conf index c3378d1f0..cc3f3ff18 100644 --- a/mods/ITEMS/mcl_beds/mod.conf +++ b/mods/ITEMS/mcl_beds/mod.conf @@ -2,4 +2,4 @@ name = mcl_beds author = BlockMen description = depends = playerphysics -optional_depends = mcl_sounds, mcl_worlds, mcl_wool, mcl_dye, mcl_explosions, mcl_weather, mcl_spawn, doc +optional_depends = mcl_sounds, mcl_worlds, mcl_wool, mcl_dye, mcl_explosions, mcl_weather, mcl_spawn, doc, mcl_nether \ No newline at end of file diff --git a/mods/ITEMS/mcl_beds/respawn_anchor.lua b/mods/ITEMS/mcl_beds/respawn_anchor.lua new file mode 100644 index 000000000..19c2c67d9 --- /dev/null +++ b/mods/ITEMS/mcl_beds/respawn_anchor.lua @@ -0,0 +1,177 @@ +--TODO: Add sounds for the respawn anchor + +--Nether ends at y -29077 +--Nether roof at y -28933 +local S = minetest.get_translator(minetest.get_current_modname()) +--local mod_doc = minetest.get_modpath("doc") -> maybe add documentation ? + +minetest.register_node("mcl_beds:respawn_anchor",{ + description=S("Respawn Anchor"), + tiles = { + "respawn_anchor_top_off.png", + "respawn_anchor_bottom.png", + "respawn_anchor_side0.png" + }, + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall + {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall + {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall + {-0.5, -0.5, -0.5, 0.5, -0.47, 0.5}, -- Bottom level, -0.47 because -0.5 is so low that you can see the texture of the block below through + } + }, + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + end + end + end, + groups = {pickaxey=1, material_stone=1}, + _mcl_hardness = 22.5 +}) +minetest.register_node("mcl_beds:respawn_anchor_charged_1",{ + description=S("Respawn Anchor"), + tiles = { + "portal.png", + "respawn_anchor_bottom.png", + "respawn_anchor_side1.png" + }, + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall + {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall + {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level + } + }, + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 +}) + +minetest.register_node("mcl_beds:respawn_anchor_charged_2",{ + description=S("Respawn Anchor"), + tiles = { + "portal.png", + "respawn_anchor_bottom.png", + "respawn_anchor_side2.png" + }, + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall + {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall + {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level + } + }, + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 +}) + +minetest.register_node("mcl_beds:respawn_anchor_charged_3",{ + description=S("Respawn Anchor"), + tiles = { + "portal.png", + "respawn_anchor_bottom.png", + "respawn_anchor_side3.png" + }, + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall + {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall + {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level + } + }, + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 +}) + +minetest.register_node("mcl_beds:respawn_anchor_charged_4",{ + description=S("Respawn Anchor"), + tiles = { + "portal.png", + "respawn_anchor_bottom.png", + "respawn_anchor_side4.png" + }, + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall + {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall + {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level + } + }, + on_rightclick = function(pos, node, player, itemstack) + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + awards.unlock(player:get_player_name(), "mcl:notQuiteNineLives") + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 +}) + +minetest.register_craft({ output = "mcl_beds:respawn_anchor", + recipe = { + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}, + {"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"}, + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"} + } + }) diff --git a/mods/ITEMS/mcl_beds/textures/portal.png b/mods/ITEMS/mcl_beds/textures/portal.png new file mode 100644 index 000000000..160ad95f3 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/portal.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_bottom.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_bottom.png new file mode 100644 index 000000000..d5d332c15 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_bottom.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_side0.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side0.png new file mode 100644 index 000000000..31a6e58f3 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side0.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_side1.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side1.png new file mode 100644 index 000000000..ed4667a2e Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side1.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_side2.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side2.png new file mode 100644 index 000000000..996042015 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side2.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_side3.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side3.png new file mode 100644 index 000000000..f0728943c Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side3.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_side4.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side4.png new file mode 100644 index 000000000..e9bea5371 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_side4.png differ diff --git a/mods/ITEMS/mcl_beds/textures/respawn_anchor_top_off.png b/mods/ITEMS/mcl_beds/textures/respawn_anchor_top_off.png new file mode 100644 index 000000000..a180e96e7 Binary files /dev/null and b/mods/ITEMS/mcl_beds/textures/respawn_anchor_top_off.png differ diff --git a/mods/ITEMS/mcl_cake/init.lua b/mods/ITEMS/mcl_cake/init.lua index 104071064..6a7c1f6ca 100644 --- a/mods/ITEMS/mcl_cake/init.lua +++ b/mods/ITEMS/mcl_cake/init.lua @@ -1,149 +1,149 @@ ---[[ -#!#!#!#Cake mod created by Jordan4ibanez#!#!# -#!#!#!#Released under CC Attribution-ShareAlike 3.0 Unported #!#!# -]]-- - -local CAKE_HUNGER_POINTS = 2 - -local S = minetest.get_translator(minetest.get_current_modname()) - -local cake_texture = {"cake_top.png","cake_bottom.png","cake_inner.png","cake_side.png","cake_side.png","cake_side.png"} -local slice_1 = { -7/16, -8/16, -7/16, -5/16, 0/16, 7/16} -local slice_2 = { -7/16, -8/16, -7/16, -3/16, 0/16, 7/16} -local slice_3 = { -7/16, -8/16, -7/16, -1/16, 0/16, 7/16} -local slice_4 = { -7/16, -8/16, -7/16, 1/16, 0/16, 7/16} -local slice_5 = { -7/16, -8/16, -7/16, 3/16, 0/16, 7/16} -local slice_6 = { -7/16, -8/16, -7/16, 5/16, 0/16, 7/16} - -local full_cake = { -7/16, -8/16, -7/16, 7/16, 0/16, 7/16} - -minetest.register_craft({ - output = "mcl_cake:cake", - recipe = { - {"mcl_mobitems:milk_bucket", "mcl_mobitems:milk_bucket", "mcl_mobitems:milk_bucket"}, - {"mcl_core:sugar", "mcl_throwing:egg", "mcl_core:sugar"}, - {"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"}, - }, - replacements = { - {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, - {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, - {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, - }, -}) - -minetest.register_node("mcl_cake:cake", { - description = S("Cake"), - _tt_help = S("With 7 tasty slices!").."\n"..S("Hunger points: +@1 per slice", CAKE_HUNGER_POINTS), - _doc_items_longdesc = S("Cakes can be placed and eaten to restore hunger points. A cake has 7 slices. Each slice restores 2 hunger points and 0.4 saturation points. Cakes will be destroyed when dug or when the block below them is broken."), - _doc_items_usagehelp = S("Place the cake anywhere, then rightclick it to eat a single slice. You can't eat from the cake when your hunger bar is full."), - tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"}, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - inventory_image = "cake.png", - wield_image = "cake.png", - paramtype = "light", - is_ground_content = false, - drawtype = "nodebox", - selection_box = { - type = "fixed", - fixed = full_cake - }, - node_box = { - type = "fixed", - fixed = full_cake - }, - stack_max = 1, - groups = {handy=1, cake=7, food=2,no_eat_delay=1, attached_node=1, dig_by_piston=1, comparator_signal=14}, - drop = "", - on_rightclick = function(pos, node, clicker, itemstack) - -- Cake is subject to protection - local name = clicker:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return - end - local newcake = minetest.do_item_eat(2, ItemStack("mcl_cake:cake_6"), ItemStack("mcl_cake:cake"), clicker, {type="nothing"}) - -- Check if we were allowed to eat - if newcake:get_name() ~= "mcl_cake:cake" or minetest.is_creative_enabled(clicker:get_player_name()) then - minetest.add_node(pos,{type="node",name="mcl_cake:cake_6",param2=0}) - end - end, - sounds = mcl_sounds.node_sound_leaves_defaults(), - - _food_particles = false, - _mcl_saturation = 0.4, - _mcl_blast_resistance = 0.5, - _mcl_hardness = 0.5, -}) - -local register_slice = function(level, nodebox, desc) - local this = "mcl_cake:cake_"..level - local after_eat = "mcl_cake:cake_"..(level-1) - local on_rightclick - if level > 1 then - on_rightclick = function(pos, node, clicker, itemstack) - local name = clicker:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return - end - local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack(after_eat), ItemStack(this), clicker, {type="nothing"}) - -- Check if we were allowed to eat - if newcake:get_name() ~= this or minetest.is_creative_enabled(clicker:get_player_name()) then - minetest.add_node(pos,{type="node",name=after_eat,param2=0}) - end - end - else - -- Last slice - on_rightclick = function(pos, node, clicker, itemstack) - local name = clicker:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return - end - local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"}) - -- Check if we were allowed to eat - if newcake:get_name() ~= this or minetest.is_creative_enabled(clicker:get_player_name()) then - minetest.remove_node(pos) - minetest.check_for_falling(pos) - end - end - end - - minetest.register_node(this, { - description = desc, - _doc_items_create_entry = false, - tiles = cake_texture, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - paramtype = "light", - is_ground_content = false, - drawtype = "nodebox", - selection_box = { - type = "fixed", - fixed = nodebox, - }, - node_box = { - type = "fixed", - fixed = nodebox, - }, - groups = {handy=1, cake=level, food=2,no_eat_delay=1,attached_node=1,not_in_creative_inventory=1,dig_by_piston=1,comparator_signal=level*2}, - drop = "", - on_rightclick = on_rightclick, - sounds = mcl_sounds.node_sound_leaves_defaults(), - - _food_particles = false, - _mcl_saturation = 0.4, - _mcl_blast_resistance = 0.5, - _mcl_hardness = 0.5, - }) - - if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_cake:cake", "nodes", "mcl_cake:cake_"..level) - end -end - -register_slice(6, slice_6, S("Cake (6 Slices Left)")) -register_slice(5, slice_5, S("Cake (5 Slices Left)")) -register_slice(4, slice_4, S("Cake (4 Slices Left)")) -register_slice(3, slice_3, S("Cake (3 Slices Left)")) -register_slice(2, slice_2, S("Cake (2 Slices Left)")) -register_slice(1, slice_1, S("Cake (1 Slice Left)")) +--[[ +#!#!#!#Cake mod created by Jordan4ibanez#!#!# +#!#!#!#Released under CC Attribution-ShareAlike 3.0 Unported #!#!# +]]-- + +local CAKE_HUNGER_POINTS = 2 + +local S = minetest.get_translator(minetest.get_current_modname()) + +local cake_texture = {"cake_top.png","cake_bottom.png","cake_inner.png","cake_side.png","cake_side.png","cake_side.png"} +local slice_1 = { -7/16, -8/16, -7/16, -5/16, 0/16, 7/16} +local slice_2 = { -7/16, -8/16, -7/16, -3/16, 0/16, 7/16} +local slice_3 = { -7/16, -8/16, -7/16, -1/16, 0/16, 7/16} +local slice_4 = { -7/16, -8/16, -7/16, 1/16, 0/16, 7/16} +local slice_5 = { -7/16, -8/16, -7/16, 3/16, 0/16, 7/16} +local slice_6 = { -7/16, -8/16, -7/16, 5/16, 0/16, 7/16} + +local full_cake = { -7/16, -8/16, -7/16, 7/16, 0/16, 7/16} + +minetest.register_craft({ + output = "mcl_cake:cake", + recipe = { + {"mcl_mobitems:milk_bucket", "mcl_mobitems:milk_bucket", "mcl_mobitems:milk_bucket"}, + {"mcl_core:sugar", "mcl_throwing:egg", "mcl_core:sugar"}, + {"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"}, + }, + replacements = { + {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, + {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, + {"mcl_mobitems:milk_bucket", "mcl_buckets:bucket_empty"}, + }, +}) + +minetest.register_node("mcl_cake:cake", { + description = S("Cake"), + _tt_help = S("With 7 tasty slices!").."\n"..S("Hunger points: +@1 per slice", CAKE_HUNGER_POINTS), + _doc_items_longdesc = S("Cakes can be placed and eaten to restore hunger points. A cake has 7 slices. Each slice restores 2 hunger points and 0.4 saturation points. Cakes will be destroyed when dug or when the block below them is broken."), + _doc_items_usagehelp = S("Place the cake anywhere, then rightclick it to eat a single slice. You can't eat from the cake when your hunger bar is full."), + tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"}, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, + inventory_image = "cake.png", + wield_image = "cake.png", + paramtype = "light", + is_ground_content = false, + drawtype = "nodebox", + selection_box = { + type = "fixed", + fixed = full_cake + }, + node_box = { + type = "fixed", + fixed = full_cake + }, + stack_max = 1, + groups = {handy=1, cake=7, food=2, no_eat_delay=1, compostability=100, attached_node=1, dig_by_piston=1, comparator_signal=14}, + drop = "", + on_rightclick = function(pos, node, clicker, itemstack) + -- Cake is subject to protection + local name = clicker:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return + end + local newcake = minetest.do_item_eat(2, ItemStack("mcl_cake:cake_6"), ItemStack("mcl_cake:cake"), clicker, {type="nothing"}) + -- Check if we were allowed to eat + if newcake:get_name() ~= "mcl_cake:cake" or minetest.is_creative_enabled(clicker:get_player_name()) then + minetest.add_node(pos,{type="node",name="mcl_cake:cake_6",param2=0}) + end + end, + sounds = mcl_sounds.node_sound_leaves_defaults(), + + _food_particles = false, + _mcl_saturation = 0.4, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + +local register_slice = function(level, nodebox, desc) + local this = "mcl_cake:cake_"..level + local after_eat = "mcl_cake:cake_"..(level-1) + local on_rightclick + if level > 1 then + on_rightclick = function(pos, node, clicker, itemstack) + local name = clicker:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return + end + local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack(after_eat), ItemStack(this), clicker, {type="nothing"}) + -- Check if we were allowed to eat + if newcake:get_name() ~= this or minetest.is_creative_enabled(clicker:get_player_name()) then + minetest.add_node(pos,{type="node",name=after_eat,param2=0}) + end + end + else + -- Last slice + on_rightclick = function(pos, node, clicker, itemstack) + local name = clicker:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return + end + local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"}) + -- Check if we were allowed to eat + if newcake:get_name() ~= this or minetest.is_creative_enabled(clicker:get_player_name()) then + minetest.remove_node(pos) + minetest.check_for_falling(pos) + end + end + end + + minetest.register_node(this, { + description = desc, + _doc_items_create_entry = false, + tiles = cake_texture, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, + paramtype = "light", + is_ground_content = false, + drawtype = "nodebox", + selection_box = { + type = "fixed", + fixed = nodebox, + }, + node_box = { + type = "fixed", + fixed = nodebox, + }, + groups = {handy=1, cake=level, food=2, no_eat_delay=1, compostability=100, attached_node=1, not_in_creative_inventory=1, dig_by_piston=1, comparator_signal=level*2}, + drop = "", + on_rightclick = on_rightclick, + sounds = mcl_sounds.node_sound_leaves_defaults(), + + _food_particles = false, + _mcl_saturation = 0.4, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, + }) + + if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_cake:cake", "nodes", "mcl_cake:cake_"..level) + end +end + +register_slice(6, slice_6, S("Cake (6 Slices Left)")) +register_slice(5, slice_5, S("Cake (5 Slices Left)")) +register_slice(4, slice_4, S("Cake (4 Slices Left)")) +register_slice(3, slice_3, S("Cake (3 Slices Left)")) +register_slice(2, slice_2, S("Cake (2 Slices Left)")) +register_slice(1, slice_1, S("Cake (1 Slice Left)")) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 55866f5cc..4b6fcd318 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -128,8 +128,9 @@ minetest.register_craft({ minetest.register_abm({ label = "cauldrons", nodenames = {"group:cauldron_filled"}, - interval = 0.5, + interval = 1, chance = 1, + -- TODO: Move to playerinfo/playerplus/mob api action = function(pos, node) for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.4)) do if mcl_burning.is_burning(obj) then diff --git a/mods/ITEMS/mcl_compass/init.lua b/mods/ITEMS/mcl_compass/init.lua index 458ee8fdb..dbb2e8358 100644 --- a/mods/ITEMS/mcl_compass/init.lua +++ b/mods/ITEMS/mcl_compass/init.lua @@ -1,3 +1,5 @@ +--TODO: Add advancement + local S = minetest.get_translator(minetest.get_current_modname()) mcl_compass = {} @@ -9,28 +11,58 @@ local compass_frames = 32 -- Timer for random compass spinning local random_timer = 0 -local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Increase if there are performance problems +local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Incr ease if there are performance problems local random_frame = math.random(0, compass_frames-1) -function mcl_compass.get_compass_image(pos, dir) +function mcl_compass.get_compass_image(pos, dir, x, y, z) -- Compasses do not work in certain zones - if mcl_worlds.compass_works(pos) then - local spawn = {x=0,y=0,z=0} - local ssp = minetest.setting_get_pos("static_spawnpoint") - if ssp then - spawn = ssp - if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then - spawn = {x=0,y=0,z=0} + if mcl_worlds.compass_works(pos) and x ~= nil and y ~= nil and z ~= nil then + local _, dim = mcl_worlds.y_to_layer(y) + local _, playerdim = mcl_worlds.y_to_layer(pos.y) + + if dim == playerdim then --Check if player and compass target are in the same dimension, above check is just if the diemension is valid for the non lodestone compass + local spawn = {x=x,y=y,z=z} + local ssp = minetest.setting_get_pos("static_spawnpoint") + if ssp and x == 0 and y == 0 and z == 0 then + spawn = ssp + if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then + spawn = {x=0,y=0,z=0} + end end + local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z)) + if angle_north < 0 then angle_north = angle_north + 360 end + local angle_dir = -math.deg(dir) + local angle_relative = (angle_north - angle_dir + 180) % 360 + return math.floor((angle_relative/11.25) + 0.5) % compass_frames + else + return random_frame end - local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z)) - if angle_north < 0 then angle_north = angle_north + 360 end - local angle_dir = -math.deg(dir) - local angle_relative = (angle_north - angle_dir + 180) % 360 - return math.floor((angle_relative/11.25) + 0.5) % compass_frames else - return random_frame + if x ~= 0 and y ~= 0 and z~= 0 and x ~= nil and y ~= nil and x~= nil then + local _, dim = mcl_worlds.y_to_layer(y) + local _, playerdim = mcl_worlds.y_to_layer(pos.y) + if dim == playerdim then --already explained that very same if statement above + local spawn = {x=x,y=y,z=z} + local ssp = minetest.setting_get_pos("static_spawnpoint") + if ssp and x == 0 and y == 0 and z == 0 then + spawn = ssp + if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then + spawn = {x=0,y=0,z=0} + end + end + local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z)) + if angle_north < 0 then angle_north = angle_north + 360 end + local angle_dir = -math.deg(dir) + local angle_relative = (angle_north - angle_dir + 180) % 360 + return math.floor((angle_relative/11.25) + 0.5) % compass_frames + else + return random_frame + end + + else + return random_frame + end end end @@ -52,9 +84,39 @@ minetest.register_globalstep(function(dtime) end if has_compass(player) then local pos = player:get_pos() - local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal()) for j,stack in pairs(player:get_inventory():get_list("main")) do + x = stack:get_meta():get_string("x") -- i know i could write the pos in meta, but i like this method more, and it is basicly the same, since else there would be one table with 3 values, and i have 3 values on their own + y = stack:get_meta():get_string("y") + z = stack:get_meta():get_string("z") + + x = tonumber(x) + y = tonumber(y) + z = tonumber(z) + + if x == nil or y == nil or z == nil then --checking if the compass has lodestone meta + compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), 0, 0, 0) --no lodestone meta + else + checkblock = {x = x, y = y, z = z} + local function get_far_node(pos) --function that tries to read node normally, and does it even if its unloaded https://dev.minetest.net/minetest.get_node + local node = minetest.get_node(pos) + if node.name == "ignore" then + minetest.get_voxel_manip():read_from_map(pos, pos) + node = minetest.get_node(pos) + end + return node + end + + if get_far_node(checkblock).name == "mcl_compass:lodestone" then --check if lodestone still exists + compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), x, y, z) + compass_image = compass_image .. "_lodestone" + else -- lodestone got destroyed + compass_image = random_frame .. "_lodestone" + end + + + end + if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then local itemname = "mcl_compass:"..compass_image @@ -81,8 +143,8 @@ for i,img in ipairs(images) do inv = 0 end local use_doc, longdesc, tt - --Why is there no usage help? This should be fixed. - --local usagehelp + --Why is there no usage help? This should be fixed. + --local usagehelp use_doc = i == stereotype_frame if use_doc then tt = S("Points to the world origin") @@ -100,6 +162,18 @@ for i,img in ipairs(images) do stack_max = 64, groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 } }) + + minetest.register_craftitem(itemstring .. "_lodestone", { + description = S("Lodestone Compass"), + _tt_help = tt, + _doc_items_create_entry = use_doc, + _doc_items_longdesc = longdesc, + --_doc_items_usagehelp = usagehelp, + inventory_image = img .. "^[colorize:purple:50", + wield_image = img .. "^[colorize:purple:50", + stack_max = 64, + groups = {not_in_creative_inventory=1, compass=i, tool=1, disable_repair=1 } + }) -- Help aliases. Makes sure the lookup tool works correctly if not use_doc and doc_mod then @@ -116,9 +190,42 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "mcl_compass:lodestone", + recipe = { + {"mcl_core:stonebrickcarved","mcl_core:stonebrickcarved","mcl_core:stonebrickcarved"}, + {"mcl_core:stonebrickcarved", "mcl_nether:netherite_ingot", "mcl_core:stonebrickcarved"}, + {"mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved"} + } +}) + minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame) -- Export stereotype item for other mods to use mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame) +minetest.register_node("mcl_compass:lodestone",{ + description=S("Lodestone"), + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack).match(itemstack.get_name(itemstack),"mcl_compass:") then + if itemstack.get_name(itemstack) ~= "mcl_compass:lodestone" then + itemstack:get_meta():set_string("x", pos.x) + itemstack:get_meta():set_string("y", pos.y) + itemstack:get_meta():set_string("z", pos.z) + end + end + end, + tiles = { + "lodestone_top.png", + "lodestone_bottom.png", + "lodestone_side1.png", + "lodestone_side2.png", + "lodestone_side3.png", + "lodestone_side4.png" + }, + groups = {pickaxey=1, material_stone=1}, + _mcl_hardness = 1.5, + _mcl_blast_resistance = 6, + sounds = mcl_sounds.node_sound_stone_defaults() +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr b/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr index 89299fde7..8ad4bda79 100644 --- a/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr +++ b/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr @@ -2,3 +2,5 @@ Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=Les boussoles sont des outils qui pointent vers l'origine du monde (X@=0,Z@=0) ou le point d'apparition dans l'Overworld. Compass=Boussole Points to the world origin=Pointe vers l'origine mondiale +Lodestone Compass=Boussole magnétisée +Lodestone=Magnétite diff --git a/mods/ITEMS/mcl_compass/locale/template.txt b/mods/ITEMS/mcl_compass/locale/template.txt index 462a08bc4..48157aa14 100644 --- a/mods/ITEMS/mcl_compass/locale/template.txt +++ b/mods/ITEMS/mcl_compass/locale/template.txt @@ -2,3 +2,5 @@ Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.= Compass= Points to the world origin= +Lodestone Compass= +Lodestone= \ No newline at end of file diff --git a/mods/ITEMS/mcl_compass/mod.conf b/mods/ITEMS/mcl_compass/mod.conf index 41266222b..b807d678e 100644 --- a/mods/ITEMS/mcl_compass/mod.conf +++ b/mods/ITEMS/mcl_compass/mod.conf @@ -1,4 +1,4 @@ name = mcl_compass description = A compass item which points towards the world origin. -depends = mcl_core, mcl_worlds, mesecons -optional_depends = doc +depends = mcl_core, mcl_worlds, mesecons, mcl_nether, mcl_sounds +optional_depends = doc \ No newline at end of file diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_bottom.png b/mods/ITEMS/mcl_compass/textures/lodestone_bottom.png new file mode 100644 index 000000000..64ddb76ce Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_bottom.png differ diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_side1.png b/mods/ITEMS/mcl_compass/textures/lodestone_side1.png new file mode 100644 index 000000000..a4446b95e Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_side1.png differ diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_side2.png b/mods/ITEMS/mcl_compass/textures/lodestone_side2.png new file mode 100644 index 000000000..fd9a1a2a5 Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_side2.png differ diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_side3.png b/mods/ITEMS/mcl_compass/textures/lodestone_side3.png new file mode 100644 index 000000000..43224083d Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_side3.png differ diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_side4.png b/mods/ITEMS/mcl_compass/textures/lodestone_side4.png new file mode 100644 index 000000000..21dadc9f7 Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_side4.png differ diff --git a/mods/ITEMS/mcl_compass/textures/lodestone_top.png b/mods/ITEMS/mcl_compass/textures/lodestone_top.png new file mode 100644 index 000000000..77c2064e1 Binary files /dev/null and b/mods/ITEMS/mcl_compass/textures/lodestone_top.png differ diff --git a/mods/ITEMS/mcl_composters/init.lua b/mods/ITEMS/mcl_composters/init.lua index a3e219bb2..6c0450b2f 100644 --- a/mods/ITEMS/mcl_composters/init.lua +++ b/mods/ITEMS/mcl_composters/init.lua @@ -32,108 +32,6 @@ minetest.register_craft({ } }) -local compostability = { - ["mcl_cake:cake"] = 100, - ["mcl_farming:pumpkin_pie"] = 100, - - ["mcl_farming:potato_item_baked"] = 85, - ["mcl_farming:bread"] = 85, - ["mcl_farming:cookie"] = 85, - ["mcl_farming:hay_block"] = 85, - -- mushroom cap block have 64 variants, wtf!? - ["mcl_mushrooms:brown_mushroom_block_cap_111111"] = 85, - ["mcl_mushrooms:red_mushroom_block_cap_111111"] = 85, - ["mcl_nether:nether_wart_block"] = 85, - ["mcl_mushroom:warped_wart_block"] = 85, - - ["mcl_core:apple"] = 65, - -- missing: azalea - ["mcl_farming:beetroot_item"] = 65, - -- missing: big dripleaf - ["mcl_farming:carrot_item"] = 65, - -- what's up with cocoa beans? - ["mcl_dye:brown"] = 65, - ["mcl_flowers:fern"] = 65, - ["mcl_flowers:double_fern"] = 65, - ["mcl_flowers:allium"] = 65, - ["mcl_flowers:azure_bluet"] = 65, - ["mcl_flowers:blue_orchid"] = 65, - ["mcl_flowers:dandelion"] = 65, - ["mcl_flowers:lilac"] = 65, - ["mcl_flowers:oxeye_daisy"] = 65, - ["mcl_flowers:poppy"] = 65, - ["mcl_flowers:tulip_orange"] = 65, - ["mcl_flowers:tulip_pink"] = 65, - ["mcl_flowers:tulip_red"] = 65, - ["mcl_flowers:tulip_white"] = 65, - ["mcl_flowers:peony"] = 65, - ["mcl_flowers:rose_bush"] = 65, - ["mcl_flowers:sunflower"] = 65, - ["mcl_flowers:waterlily"] = 65, - ["mcl_farming:melon"] = 65, - ["mcl_core:moss"] = 65, - -- mushroom aliases below? - ["mcl_farming:mushroom_brown"] = 65, - ["mcl_mushrooms:mushroom_brown"] = 65, - ["mcl_farming:mushroom_red"] = 65, - ["mcl_mushrooms:mushroom_red"] = 65, - ["mcl_mushrooms:brown_mushroom_block_stem_full"] = 65, - ["mcl_mushrooms:red_mushroom_block_stem_full"] = 65, - -- nether wart - ["mcl_farming:potato_item"] = 65, - ["mcl_farming:pumpkin"] = 65, - ["mcl_farming:pumpkin_face_light"] = 65, - ["mcl_ocean:sea_pickle_"] = 65, - ["mcl_mushroom:shroomlight"] = 65, - -- missing: spore blossom - ["mcl_farming:wheat_item"] = 65, - ["mcl_mushroom:crimson_fungus"] = 65, - ["mcl_mushroom:warped_fungus"] = 65, - ["mcl_mushroom:crimson_roots"] = 65, - ["mcl_mushroom:warped_roots"] = 65, - - ["mcl_core:cactus"] = 50, - ["mcl_ocean:dried_kelp_block"] = 50, - -- missing: flowering azalea leaves - -- missing: glow lichen - ["mcl_farming:melon_item"] = 50, - ["mcl_mushroom:nether_sprouts"] = 50, - ["mcl_core:reeds"] = 50, - ["mcl_flowers:double_grass"] = 50, - ["mcl_core:vine"] = 50, - -- missing: weeping vines - ["mcl_mushroom:twisting_vines"] = 50, - - ["mcl_flowers:tallgrass"] = 30, - ["mcl_farming:beetroot_seeds"] = 30, - ["mcl_core:dirt_with_grass"] = 30, - ["mcl_core:tallgrass"] = 30, - ["mcl_ocean:dried_kelp"] = 30, - ["mcl_ocean:kelp"] = 30, - ["mcl_core:leaves"] = 30, - ["mcl_core:acacialeaves"] = 30, - ["mcl_core:birchleaves"] = 30, - ["mcl_core:darkleaves"] = 30, - ["mcl_core:jungleleaves"] = 30, - ["mcl_core:spruceleaves"] = 30, - -- - ["mcl_farming:melon_seeds"] = 30, - ["mcl_core:moss_carpet"] = 30, - ["mcl_farming:pumpkin_seeds"] = 30, - ["mcl_core:sapling"] = 30, - ["mcl_core:acaciasapling"] = 30, - ["mcl_core:birchsapling"] = 30, - ["mcl_core:darksapling"] = 30, - ["mcl_core:junglesapling"] = 30, - ["mcl_core:sprucesapling"] = 30, - ["mcl_ocean:seagrass"] = 30, - -- missing: small dripleaf - ["mcl_sweet_berry:sweet_berry"] = 30, - ["mcl_farming:sweet_berry"] = 30, - ["mcl_farming:wheat_seeds"] = 30, - -} - local function composter_add_item(pos, node, player, itemstack, pointed_thing) -- -- handler for filling the composter when rightclicked @@ -147,8 +45,9 @@ local function composter_add_item(pos, node, player, itemstack, pointed_thing) return itemstack end local itemname = itemstack:get_name() - local chance = compostability[itemname] - if chance then + local chance = minetest.get_item_group(itemname, "compostability") + + if chance > 0 then if not minetest.is_creative_enabled(player:get_player_name()) then itemstack:take_item() end diff --git a/mods/ITEMS/mcl_core/README.txt b/mods/ITEMS/mcl_core/README.txt index 6c48d74fd..88da2f88d 100644 --- a/mods/ITEMS/mcl_core/README.txt +++ b/mods/ITEMS/mcl_core/README.txt @@ -21,6 +21,14 @@ MIT License. The textures are taken from the Minecraft resource pack “Faithful 1.11” by Vattic and xMrVizzy and contributers. + +CC BY-SA 4.0 + +mcl_core_lava_spark.png is based on the Pixel Perfection resource pack for Minecraft 1.11, +authored by XSSheep. +Source: +License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) + Sounds ====== All sounds included in this mod are under the MIT License. diff --git a/mods/ITEMS/mcl_core/craftitems.lua b/mods/ITEMS/mcl_core/craftitems.lua index 85a078766..26519ab7e 100644 --- a/mods/ITEMS/mcl_core/craftitems.lua +++ b/mods/ITEMS/mcl_core/craftitems.lua @@ -139,7 +139,7 @@ minetest.register_craftitem("mcl_core:apple", { stack_max = 64, on_place = minetest.item_eat(4), on_secondary_use = minetest.item_eat(4), - groups = { food = 2, eatable = 4 }, + groups = { food = 2, eatable = 4, compostability=65 }, _mcl_saturation = 2.4, }) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 20978e26f..407766d08 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -54,6 +54,137 @@ minetest.register_abm({ end, }) + +-- +-- Production of sparks from lava +-- + +local LAVA_SPARK_ABM_INTERVAL = 5 +local lava_spark_limit = minetest.settings:get("mcl_core_lava_spark_limit") +if lava_spark_limit == nil then + lava_spark_limit = 10 +else + lava_spark_limit = tonumber(lava_spark_limit) +end +local lava_spark_chance = 0 +local lava_spark_abm_census = 0 +local lava_spark_census = 0 + +function mcl_core.lava_spark_set_chance() + lava_spark_chance = lava_spark_limit / lava_spark_abm_census + minetest.after(LAVA_SPARK_ABM_INTERVAL, mcl_core.lava_spark_set_chance) + lava_spark_abm_census = 0 + lava_spark_census = 0 +end + +if lava_spark_limit > 0 then + mcl_core.lava_spark_set_chance() + + minetest.register_abm({ + label = "Lava produce sparks", + nodenames = {"group:lava"}, + neighbors = {"air"}, + interval = LAVA_SPARK_ABM_INTERVAL, + chance = 18, + action = function(pos, node) + local above = minetest.get_node(vector.new(pos.x, pos.y + 1, pos.z)) + if above.name ~= "air" then return end + + lava_spark_abm_census = lava_spark_abm_census + 1 + + if lava_spark_census >= lava_spark_limit then return end + if math.random() > lava_spark_chance then return end + + lava_spark_census = lava_spark_census + 1 + minetest.after(math.random() * LAVA_SPARK_ABM_INTERVAL, mcl_core.lava_spark_add, pos) + end + }) +end + +function mcl_core.lava_spark_add(pos) + local node = minetest.get_node(pos) + if minetest.get_node_group(node.name, "lava") == 0 then return end + + local above = minetest.get_node(vector.new(pos.x, pos.y + 1, pos.z)) + if above.name ~= "air" then return end + + local pos_addend = vector.new( + (math.random() - 0.5) * 0.8, + (math.random() - 0.5) * 0.8, + (math.random() - 0.5) * 0.8 + ) + local spark_pos = vector.add(pos, pos_addend) + local spark = minetest.add_entity(spark_pos, "mcl_core:lava_spark") + if not spark then return end + + local velocity = vector.new( + (math.random() - 0.5) * 3, + (math.random() + 2) * 2, + (math.random() - 0.5) * 3 + ) + spark:set_velocity(velocity) + + spark:set_acceleration(vector.new(0, -9, 0)) + + -- Set a random size + local size = 0.2 + math.random() * 0.2 + local props = spark:get_properties() + if not props then return end + props.visual_size = vector.new(size, size, size) + spark:set_properties(props) + + local luaentity = spark:get_luaentity() + if not luaentity then return end + luaentity._life_timer = 0.4 + math.random() +end + +minetest.register_entity("mcl_core:lava_spark", { + physical = true, + visual = "sprite", + collide_with_objects = true, + textures = {"mcl_core_lava_spark.png"}, + glow = 10, + static_save = false, + _smoke_timer = 0.1, + _life_timer = 1, + on_step = function(self, dtime) + if not self or not self.object then return end + + self._life_timer = self._life_timer - dtime + if self._life_timer <= 0 then + self.object:remove() + return + end + + + self._smoke_timer = self._smoke_timer - dtime + if self._smoke_timer > 0 then return end + self._smoke_timer = 0.2 + math.random() * 0.3 + + local pos = self.object:get_pos() + + -- Add smoke + minetest.add_particlespawner({ + amount = 3, + time = 0.001, + minpos = pos, + maxpos = pos, + minvel = vector.new(-0.1, 1, -0.1), + maxvel = vector.new(0.1, 1.5, 0.1), + minexptime = 0.1, + maxexptime = 0.6, + minsize = 0.5, + maxsize = 1.5, + texture = "mcl_particles_smoke_anim.png", + animation = { + type = "vertical_frames", + aspect_w = 8, + aspect_h = 8, + } + }) + end +}) + -- -- Papyrus and cactus growing -- diff --git a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr index c4c818aae..83922aa86 100644 --- a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr +++ b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr @@ -92,6 +92,7 @@ Diorite=Diorite Diorite is an igneous rock.=La diorite est une roche volcanique. Dirt=Terre Dirt acts as a soil for a few plants. When in light, this block may grow a grass or mycelium cover if such blocks are nearby.=La terre agit comme un sol pour quelques plantes. Lorsqu'il est à la lumière, ce bloc peut faire pousser une couverture d'herbe ou de mycélium si ces blocs sont à proximité. +Enchanted Golden Apple=Pomme Dorée Enchantée Emerald=Emeraude Emerald Ore=Minerai d'Emeraude Emerald ore is the ore of emeralds. It is very rare and can be found alone, not in clusters.=Le minerai d'émeraude produit des émeraudes. Il est très rare et ne peut être trouvé que seul, pas en filons. @@ -154,6 +155,8 @@ Oak Wood Planks=Planches de Chêne Oak leaves are grown from oak trees.=Les feuilles de chêne sont cultivées à partir de chênes. Obsidian=Obsidienne Obsidian is an extremely hard mineral with an enourmous blast-resistance. Obsidian is formed when water meets lava.=L'obsidienne est un minéral extrêmement dur avec une énorme résistance à l'explosion. L'obsidienne se forme lorsque l'eau rencontre la lave. +Crying Obsidian=Obsidienne Pleureuse +Crying obsidian is a luminous obsidian that can generate as part of ruined portals.=L'obsidienne pleureuse est de l'obsidienne lumineuse générée comme composant des portails en ruines. One of the most common blocks in the world, almost the entire underground consists of stone. It sometimes contains ores. Stone may be created when water meets lava.=L'un des blocs les plus courants au monde, presque tout le sous-sol est en pierre. Il contient parfois des minerais. La pierre peut être créée lorsque l'eau rencontre la lave. Orange Stained Glass=Verre Orange Packed Ice=Glace Compactée @@ -202,20 +205,45 @@ Stained glass is a decorative and mostly transparent block which comes in variou Stick=Bâton Sticks are a very versatile crafting material; used in countless crafting recipes.=Les bâtons sont un matériau d'artisanat très polyvalent; utilisé dans d'innombrables recettes d'artisanat. Stone=Roche +Stripped Acacia Log=Bois d'Acacia +Stripped Acacia Wood=Bois Ecorché d'Acacia +Stripped Birch Log=Bois de Bouleau +Stripped Birch Wood=Bois Ecorché de Bouleau +Stripped Dark Oak Log=Bois de Chêne Noir +Stripped Dark Oak Wood=Bois Ecorché de Chêne Noir +Stripped Jungle Log=Bois d'Acajou +Stripped Jungle Wood=Bois Ecorché d'Acajou +Stripped Oak Log=Bois de Chêne +Stripped Oak Wood=Bois Ecorché de Chêne +Stripped Spruce Log=Bois de Sapin +Stripped Spruce Wood=Bois Ecorché de Sapin Stone Bricks=Pierre Taillée Sugar=Sucre Sugar Canes=Canne à Sucre Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well.=Les cannes à sucre sont une plante qui a certaines utilisations dans l'artisanat. Les cannes à sucre poussent lentement jusqu'à 3 blocs lorsqu'elles sont à côté de l'eau et sont placées sur un bloc d'herbe, de terre, de sable, de sable rouge, de podzol ou de terre stérile. Lorsqu'une canne à sucre est cassée, toutes les cannes à sucre connectées au-dessus se brisent également. Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=Les cannes à sucre ne peuvent être placées que sur d'autres cannes à sucre et sur des blocs sur lesquels elles poussent. Sugar comes from sugar canes and is used to make sweet foods.=Le sucre provient des cannes à sucre et est utilisé pour fabriquer des aliments sucrés. +The stripped trunk of an acacia tree.=Le tronc écorché d'un acacia. +The stripped trunk of a birch tree.=Le tronc écorché d'un bouleau. +The stripped trunk of a dark oak tree.=Le tronc écorché d'un chêne noir. +The stripped trunk of a jungle tree.=Le tronc écorché d'un acajou. +The stripped trunk of an oak tree.=Le tronc écorché d'un chêne. +The stripped trunk of a spruce tree.=Le tronc écorché d'un sapin. The trunk of a birch tree.=Le tronc d'un bouleau. The trunk of a dark oak tree.=Le tronc d'un chêne noir. The trunk of a jungle tree.=Le tronc d'un acajou. The trunk of a spruce tree.=Le tronc d'un sapin. The trunk of an acacia.=Le tronc d'un acacia The trunk of an oak tree.=Le tronc d'un chêne. +The stripped wood of an acacia tree.=Les planches écorchée d'un acacia. +The stripped wood of a birch tree.=Les planches écorchée d'un bouleau. +The stripped wood of a dark oak tree.=Les planches écorchée d'un chêne noir. +The stripped wood of a jungle tree.=Les planches écorchée d'un acajou. +The stripped wood of an oak tree.=Les planches écorchée d'un chêne. +The stripped wood of a spruce tree.=Les planches écorchée d'un sapin. This block consists of a couple of loose stones and can't support itself.=Ce bloc se compose de quelques pierres lâches et ne peut pas se soutenir. This is a decorative block surrounded by the bark of a tree trunk.=Il s'agit d'un bloc décoratif entouré par l'écorce d'un tronc d'arbre. +This is a decorative block.=Il s'agit d'un bloc décoratif. This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold.=Ceci est un bloc de neige complet. La neige de cette épaisseur se trouve généralement dans les zones de froid extrême. This is a piece of cactus commonly found in dry areas, especially deserts. Over time, cacti will grow up to 3 blocks high on sand or red sand. A cactus hurts living beings touching it with a damage of 1 HP every half second. When a cactus block is broken, all cactus blocks connected above it will break as well.=Il s'agit d'un morceau de cactus que l'on trouve couramment dans les zones sèches, en particulier dans les déserts. Au fil du temps, les cactus pousseront jusqu'à 3 blocs de haut sur le sable ou le sable rouge. Un cactus blesse les êtres vivants qui le touchent avec des dégâts de 1 HP toutes les demi-secondes. Lorsqu'un bloc de cactus est brisé, tous les blocs de cactus connectés au-dessus se brisent également. This stone contains pure gold, a rare metal.=Cette pierre contient de l'or pur, un métal rare. @@ -256,3 +284,7 @@ Slows down movement=Ralentit le mouvement 2×2 saplings @= large tree=2×2 pousses @= grand arbre Grows on sand or dirt next to water=Pousse sur le sable ou la terre près de l'eau Stackable=Empilable +Moss=Mousse +Moss Carpet=Tapis de Mousse +A moss block is a natural block that can be spread to some other blocks by using bone meal.=Un bloc de mousse est un bloc naturel qui peut se propager à d'autres blocs en utilisant de la farine d'os. +Moss Carpets are a thin decorative variant of the moss block.=Les tapis de mousse sont une fine variante décorative du bloc de mousse. \ No newline at end of file diff --git a/mods/ITEMS/mcl_core/locale/template.txt b/mods/ITEMS/mcl_core/locale/template.txt index 57b15ef82..901c0a4a3 100644 --- a/mods/ITEMS/mcl_core/locale/template.txt +++ b/mods/ITEMS/mcl_core/locale/template.txt @@ -284,3 +284,7 @@ Slows down movement= 2×2 saplings @= large tree= Grows on sand or dirt next to water= Stackable= +Moss= +Moss Carpet= +A moss block is a natural block that can be spread to some other blocks by using bone meal.= +Moss Carpets are a thin decorative variant of the moss block.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 900675688..eed6ab906 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -369,7 +369,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { color = "#8EB971", is_ground_content = true, stack_max = 64, - groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1}, + groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1, compostability=30}, drop = "mcl_core:dirt", sounds = mcl_sounds.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.1}, @@ -473,7 +473,7 @@ minetest.register_node("mcl_core:moss", { tiles = {"mcl_core_moss_block.png"}, is_ground_content = true, stack_max = 64, - groups = {handy=1, hoey=1}, + groups = {handy=1, hoey=1, compostability=65}, --sounds = TODO: add sound _mcl_blast_resistance = 0.1, _mcl_hardness = 0.1, @@ -1096,7 +1096,7 @@ minetest.register_node("mcl_core:moss", { tiles = {"mcl_core_moss_block.png"}, is_ground_content = true, stack_max = 64, - groups = {handy=1, hoey=1}, + groups = {handy=1, hoey=1, compostability=65}, --sounds = TODO: add sound _mcl_blast_resistance = 0.1, _mcl_hardness = 0.1, @@ -1153,7 +1153,7 @@ minetest.register_node("mcl_core:moss_carpet", { {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, }, }, - groups = {handy=1, hoey=1}, + groups = {handy=1, hoey=1, compostability=30}, --sounds = TODO: add sound _mcl_blast_resistance = 0.1, _mcl_hardness = 0.1, diff --git a/mods/ITEMS/mcl_core/nodes_cactuscane.lua b/mods/ITEMS/mcl_core/nodes_cactuscane.lua index e61d6df80..cea73da11 100644 --- a/mods/ITEMS/mcl_core/nodes_cactuscane.lua +++ b/mods/ITEMS/mcl_core/nodes_cactuscane.lua @@ -12,7 +12,7 @@ minetest.register_node("mcl_core:cactus", { tiles = {"mcl_core_cactus_top.png", "mcl_core_cactus_bottom.png", "mcl_core_cactus_side.png"}, is_ground_content = true, stack_max = 64, - groups = {handy=1, attached_node=1, plant=1, deco_block=1, dig_by_piston=1, enderman_takable=1}, + groups = {handy=1, attached_node=1, plant=1, deco_block=1, dig_by_piston=1, enderman_takable=1, compostability=50}, sounds = mcl_sounds.node_sound_wood_defaults(), paramtype = "light", sunlight_propagates = true, @@ -79,7 +79,7 @@ minetest.register_node("mcl_core:reeds", { }, }, stack_max = 64, - groups = {dig_immediate=3, craftitem=1, deco_block=1, plant=1, non_mycelium_plant=1, dig_by_piston=1}, + groups = {dig_immediate=3, craftitem=1, deco_block=1, plant=1, non_mycelium_plant=1, dig_by_piston=1, compostability=50}, sounds = mcl_sounds.node_sound_leaves_defaults(), node_placement_prediction = "", drop = "mcl_core:reeds", -- to prevent color inheritation diff --git a/mods/ITEMS/mcl_core/nodes_climb.lua b/mods/ITEMS/mcl_core/nodes_climb.lua index 9505bb19a..d99954e3f 100644 --- a/mods/ITEMS/mcl_core/nodes_climb.lua +++ b/mods/ITEMS/mcl_core/nodes_climb.lua @@ -104,7 +104,7 @@ minetest.register_node("mcl_core:vine", { type = "wallmounted", }, stack_max = 64, - groups = {handy=1,axey=1,shearsy=1,swordy=1, flammable=2,deco_block=1,destroy_by_lava_flow=1,dig_by_piston=1, fire_encouragement=15, fire_flammability=100}, + groups = {handy=1,axey=1,shearsy=1,swordy=1, flammable=2,deco_block=1,destroy_by_lava_flow=1,dig_by_piston=1, fire_encouragement=15, fire_flammability=100, compostability=50}, sounds = mcl_sounds.node_sound_leaves_defaults(), drop = "", _mcl_shears_drop = true, diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index a5ef7aa97..060879e17 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -162,7 +162,8 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d deco_block=1, dig_by_piston=1, fire_encouragement=30, - fire_flammability=60 + fire_flammability=60, + compostability=30 }, drop = get_drops(0), _mcl_shears_drop = true, @@ -194,7 +195,7 @@ local function register_sapling(subname, description, longdesc, tt_help, texture fixed = selbox }, stack_max = 64, - groups = {dig_immediate=3, plant=1,sapling=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1}, + groups = {dig_immediate=3, plant=1,sapling=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1, compostability=30}, sounds = mcl_sounds.node_sound_leaves_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -275,4 +276,4 @@ register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from -- Node aliases minetest.register_alias("default:acacia_tree", "mcl_core:acaciatree") -minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves") \ No newline at end of file +minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves") diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png b/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png new file mode 100644 index 000000000..079f7730e Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png differ diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index f5e282a8c..ca0ca6fe1 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -78,7 +78,7 @@ dyelocal.dyes = { {"dark_green", "dye_dark_green", S("Cactus Green"),{dye=1, craftitem=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}}, {"green", "mcl_dye_lime", S("Lime Dye"), {dye=1, craftitem=1, basecolor_green=1, excolor_green=1, unicolor_green=1}}, {"yellow", "dye_yellow", S("Dandelion Yellow"), {dye=1, craftitem=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}}, - {"brown", "mcl_dye_brown", S("Cocoa Beans"), {dye=1, craftitem=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}}, + {"brown", "mcl_dye_brown", S("Cocoa Beans"), {dye=1, craftitem=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1, compostability=65}}, {"orange", "dye_orange", S("Orange Dye"), {dye=1, craftitem=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}}, {"red", "dye_red", S("Rose Red"), {dye=1, craftitem=1, basecolor_red=1, excolor_red=1, unicolor_red=1}}, {"magenta", "dye_magenta", S("Magenta Dye"), {dye=1, craftitem=1, basecolor_magenta=1, excolor_red_violet=1,unicolor_red_violet=1}}, diff --git a/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png b/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png index 1259a5d0e..42b05a17f 100644 Binary files a/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png and b/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png differ diff --git a/mods/ITEMS/mcl_farming/beetroot.lua b/mods/ITEMS/mcl_farming/beetroot.lua index e312aa262..187f34eb4 100644 --- a/mods/ITEMS/mcl_farming/beetroot.lua +++ b/mods/ITEMS/mcl_farming/beetroot.lua @@ -5,7 +5,7 @@ minetest.register_craftitem("mcl_farming:beetroot_seeds", { _tt_help = S("Grows on farmland"), _doc_items_longdesc = S("Grows into a beetroot plant. Chickens like beetroot seeds."), _doc_items_usagehelp = S("Place the beetroot seeds on farmland (which can be created with a hoe) to plant a beetroot plant. They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it beetroot seeds."), - groups = { craftitem=1 }, + groups = { craftitem=1, compostability=30 }, inventory_image = "mcl_farming_beetroot_seeds.png", wield_image = "mcl_farming_beetroot_seeds.png", on_place = function(itemstack, placer, pointed_thing) @@ -133,7 +133,7 @@ minetest.register_craftitem("mcl_farming:beetroot_item", { wield_image = "mcl_farming_beetroot.png", on_place = minetest.item_eat(1), on_secondary_use = minetest.item_eat(1), - groups = { food = 2, eatable = 1 }, + groups = { food = 2, eatable = 1, compostability=65 }, _mcl_saturation = 1.2, }) diff --git a/mods/ITEMS/mcl_farming/carrots.lua b/mods/ITEMS/mcl_farming/carrots.lua index 7983c58a2..bdecdefed 100644 --- a/mods/ITEMS/mcl_farming/carrots.lua +++ b/mods/ITEMS/mcl_farming/carrots.lua @@ -86,7 +86,7 @@ minetest.register_craftitem("mcl_farming:carrot_item", { _doc_items_longdesc = S("Carrots can be eaten and planted. Pigs and rabbits like carrots."), _doc_items_usagehelp = S("Hold it in your hand and rightclick to eat it. Place it on top of farmland to plant the carrot. It grows in sunlight and grows faster on hydrated farmland. Rightclick an animal to feed it."), inventory_image = "farming_carrot.png", - groups = { food = 2, eatable = 3 }, + groups = { food = 2, eatable = 3, compostability=65 }, _mcl_saturation = 3.6, on_secondary_use = minetest.item_eat(3), on_place = function(itemstack, placer, pointed_thing) diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index b3e49a61f..91df5d919 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -7,7 +7,7 @@ minetest.register_craftitem("mcl_farming:melon_seeds", { _doc_items_longdesc = S("Grows into a melon stem which in turn grows melons. Chickens like melon seeds."), _doc_items_usagehelp = S("Place the melon seeds on farmland (which can be created with a hoe) to plant a melon stem. Melon stems grow in sunlight and grow faster on hydrated farmland. When mature, the stem will attempt to grow a melon at the side. Rightclick an animal to feed it melon seeds."), stack_max = 64, - groups = { craftitem=1 }, + groups = { craftitem=1, compostability=30 }, inventory_image = "mcl_farming_melon_seeds.png", on_place = function(itemstack, placer, pointed_thing) return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:melontige_1") @@ -21,7 +21,7 @@ local melon_base_def = { _doc_items_longdesc = S("A melon is a block which can be grown from melon stems, which in turn are grown from melon seeds. It can be harvested for melon slices."), stack_max = 64, tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png", "farming_melon_side.png", "farming_melon_side.png", "farming_melon_side.png"}, - groups = {handy=1,axey=1, plant=1,building_block=1,enderman_takable=1,dig_by_piston=1}, + groups = {handy=1,axey=1, plant=1,building_block=1,enderman_takable=1,dig_by_piston=1, compostability=65}, drop = { max_items = 1, items = { @@ -134,7 +134,7 @@ minetest.register_craftitem("mcl_farming:melon_item", { inventory_image = "farming_melon.png", on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), - groups = { food = 2, eatable = 2 }, + groups = { food = 2, eatable = 2, compostability=50 }, _mcl_saturation = 1.2, }) diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 79cd13115..a4f6a4360 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 }, + groups = { food = 2, eatable = 1, compostability=65 }, _mcl_saturation = 0.6, stack_max = 64, on_secondary_use = minetest.item_eat(1), @@ -112,7 +112,7 @@ minetest.register_craftitem("mcl_farming:potato_item_baked", { inventory_image = "farming_potato_baked.png", on_place = minetest.item_eat(5), on_secondary_use = minetest.item_eat(5), - groups = { food = 2, eatable = 5 }, + groups = { food = 2, eatable = 5, compostability = 85 }, _mcl_saturation = 6.0, }) diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 0eb71ac91..72d0057dc 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -15,7 +15,7 @@ minetest.register_craftitem("mcl_farming:pumpkin_seeds", { _doc_items_usagehelp = S("Place the pumpkin seeds on farmland (which can be created with a hoe) to plant a pumpkin stem. Pumpkin stems grow in sunlight and grow faster on hydrated farmland. When mature, the stem attempts to grow a pumpkin next to it. Rightclick an animal to feed it pumpkin seeds."), stack_max = 64, inventory_image = "mcl_farming_pumpkin_seeds.png", - groups = { craftitem=1 }, + groups = { craftitem=1, compostability=30 }, on_place = function(itemstack, placer, pointed_thing) return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:pumpkin_1") end @@ -99,7 +99,7 @@ local pumpkin_base_def = { stack_max = 64, paramtype2 = "facedir", tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png"}, - groups = {handy=1,axey=1, plant=1,building_block=1, dig_by_piston=1, enderman_takable=1}, + groups = {handy=1,axey=1, plant=1,building_block=1, dig_by_piston=1, enderman_takable=1, compostability=65}, sounds = mcl_sounds.node_sound_wood_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 1, @@ -192,7 +192,7 @@ minetest.register_node("mcl_farming:pumpkin_face_light", { paramtype2 = "facedir", light_source = minetest.LIGHT_MAX, tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_light.png"}, - groups = {handy=1,axey=1, building_block=1, dig_by_piston=1 }, + groups = {handy=1,axey=1, building_block=1, dig_by_piston=1, compostability=65 }, sounds = mcl_sounds.node_sound_wood_defaults(), on_construct = function(pos) -- Attempt to spawn iron golem or snow golem @@ -230,7 +230,7 @@ minetest.register_craftitem("mcl_farming:pumpkin_pie", { wield_image = "mcl_farming_pumpkin_pie.png", on_place = minetest.item_eat(8), on_secondary_use = minetest.item_eat(8), - groups = { food = 2, eatable = 8 }, + groups = { food = 2, eatable = 8, compostability=100 }, _mcl_saturation = 4.8, }) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index d74739aaa..f215851e3 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -31,7 +31,7 @@ minetest.register_craftitem("mcl_farming:sweet_berry", { inventory_image = "mcl_farming_sweet_berry.png", _mcl_saturation = 0.2, stack_max = 64, - groups = { food = 2, eatable = 1 }, + groups = { food = 2, eatable = 1, compostability=30 }, on_secondary_use = minetest.item_eat(1), on_place = function(itemstack, placer, pointed_thing) local new = mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_sweet_berry:sweet_berry_bush_0") diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index da1b84b2d..0e81f42bf 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -9,7 +9,7 @@ minetest.register_craftitem("mcl_farming:wheat_seeds", { Place the wheat seeds on farmland (which can be created with a hoe) to plant a wheat plant. They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it wheat seeds. ]]), - groups = { craftitem=1 }, + groups = { craftitem=1, compostability=30 }, inventory_image = "mcl_farming_wheat_seeds.png", on_place = function(itemstack, placer, pointed_thing) return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:wheat_1") @@ -104,7 +104,7 @@ minetest.register_craftitem("mcl_farming:wheat_item", { _doc_items_longdesc = S("Wheat is used in crafting. Some animals like wheat."), _doc_items_usagehelp = S("Use the “Place” key on an animal to try to feed it wheat."), inventory_image = "farming_wheat_harvested.png", - groups = { craftitem = 1 }, + groups = { craftitem = 1, compostability=65 }, }) minetest.register_craft({ @@ -125,7 +125,7 @@ minetest.register_craftitem("mcl_farming:cookie", { description = S("Cookie"), _doc_items_longdesc = S("This is a food item which can be eaten."), inventory_image = "farming_cookie.png", - groups = {food=2, eatable=2}, + groups = {food=2, eatable=2, compostability=85}, _mcl_saturation = 0.4, on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), @@ -136,7 +136,7 @@ minetest.register_craftitem("mcl_farming:bread", { description = S("Bread"), _doc_items_longdesc = S("This is a food item which can be eaten."), inventory_image = "farming_bread.png", - groups = {food=2, eatable=5}, + groups = {food=2, eatable=5, compostability=85}, _mcl_saturation = 6.0, on_place = minetest.item_eat(5), on_secondary_use = minetest.item_eat(5), @@ -156,8 +156,7 @@ minetest.register_node("mcl_farming:hay_block", { stack_max = 64, paramtype2 = "facedir", on_place = mcl_util.rotate_axis, - groups = {handy=1, hoey=1, flammable=2, fire_encouragement=60, - fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, + groups = {handy=1, hoey=1, compostability=85, flammable=2, fire_encouragement=60, fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, sounds = mcl_sounds.node_sound_leaves_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 0.5, diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 788e591dc..d779a2a98 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -385,7 +385,7 @@ minetest.register_tool("mcl_fishing:fishing_rod", { _doc_items_usagehelp = S("Rightclick to launch the bobber. When it sinks right-click again to reel in an item. Who knows what you're going to catch?"), groups = { tool=1, fishing_rod=1, enchantability=1 }, inventory_image = "mcl_fishing_fishing_rod.png", - wield_image = "mcl_fishing_fishing_rod.png^[transformR270", + wield_image = "mcl_fishing_fishing_rod.png^[transformFY^[transformR90", wield_scale = { x = 1.5, y = 1.5, z = 1 }, stack_max = 1, on_place = fish, diff --git a/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png b/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png index 2fbcc7344..d1cd9dd03 100644 Binary files a/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png and b/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png differ diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 14e0df5cb..9c04ebcf5 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -80,7 +80,7 @@ function mcl_flowers.register_simple_flower(name, def) walkable = false, stack_max = 64, drop = def.drop, - groups = {dig_immediate=3,flammable=2,fire_encouragement=60,fire_flammability=100,plant=1,flower=1,place_flowerlike=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1}, + groups = {dig_immediate=3,flammable=2,fire_encouragement=60,fire_flammability=100,plant=1,flower=1,place_flowerlike=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1, compostability=65}, sounds = mcl_sounds.node_sound_leaves_defaults(), node_placement_prediction = "", on_place = on_place_flower, @@ -143,7 +143,7 @@ local def_tallgrass = { walkable = false, buildable_to = true, is_ground_content = true, - groups = {handy=1,shearsy=1, flammable=3,fire_encouragement=60,fire_flammability=100,attached_node=1,plant=1,place_flowerlike=2,non_mycelium_plant=1,dig_by_water=1,destroy_by_lava_flow=1,deco_block=1}, + groups = {handy=1,shearsy=1, flammable=3,fire_encouragement=60,fire_flammability=100,attached_node=1,plant=1,place_flowerlike=2,non_mycelium_plant=1,dig_by_water=1,destroy_by_lava_flow=1,deco_block=1, compostability=30}, sounds = mcl_sounds.node_sound_leaves_defaults(), drop = wheat_seed_drop, _mcl_shears_drop = true, @@ -163,6 +163,7 @@ def_fern._doc_items_longdesc = S("Ferns are small plants which occur naturally i def_fern.tiles = { "mcl_flowers_fern.png" } def_fern.inventory_image = "mcl_flowers_fern_inv.png" def_fern.wield_image = "mcl_flowers_fern_inv.png" +def_fern.groups.compostability=65 def_fern.selection_box = { type = "fixed", fixed = { -6/16, -0.5, -6/16, 6/16, 5/16, 6/16 }, @@ -205,6 +206,13 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im bottom_groups.not_in_creative_inventory = 1 create_entry = false end + -- some special cases for the composter group + if name == "double_fern" or "peony" or "rose_bush" or "lilac" or "sunflower" then + bottom_groups.compostability = 65 + end + if name == "double_grass" then + bottom_groups.compostability = 50 + end -- Drop itself by default local drop_bottom, drop_top if not drop then @@ -410,7 +418,7 @@ minetest.register_node("mcl_flowers:waterlily", { liquids_pointable = true, walkable = true, sunlight_propagates = true, - groups = {dig_immediate = 3, plant=1, dig_by_water = 1,destroy_by_lava_flow=1, dig_by_piston = 1, deco_block=1, dig_by_boat=1}, + groups = {dig_immediate = 3, plant=1, dig_by_water = 1,destroy_by_lava_flow=1, dig_by_piston = 1, deco_block=1, dig_by_boat=1, compostability=65}, sounds = mcl_sounds.node_sound_leaves_defaults(), node_placement_prediction = "", node_box = { diff --git a/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr b/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr index f7b37e537..6140504ef 100644 --- a/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr +++ b/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr @@ -7,3 +7,7 @@ Burning Furnace=Four Allumé Recipe book=Livre de Recette Inventory=Inventaire Uses fuel to smelt or cook items=Utilise du carburant pour fondre ou cuire des articles +Blast Furnace=Haut Fourneau +Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.=Un haut fourneau peut cuire ou fondre plusieurs objets, en quelque chose d'autre, en utilisant du carburant, plus vite qu'un four normal. +Smoker=Fumoir +Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.=Le Fumoir peut cuire ou fondre plusieurs objets, en quelque chose d'autre, en utilisant du carburant, plus vite qu'un four normal. diff --git a/mods/ITEMS/mcl_furnaces/locale/template.txt b/mods/ITEMS/mcl_furnaces/locale/template.txt index 4f88824b0..d48de3909 100644 --- a/mods/ITEMS/mcl_furnaces/locale/template.txt +++ b/mods/ITEMS/mcl_furnaces/locale/template.txt @@ -7,3 +7,7 @@ Burning Furnace= Recipe book= Inventory= Uses fuel to smelt or cook items= +Blast Furnace= +Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.= +Smoker= +Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.= diff --git a/mods/ITEMS/mcl_lanterns/init.lua b/mods/ITEMS/mcl_lanterns/init.lua index e6707b075..8f99ea151 100644 --- a/mods/ITEMS/mcl_lanterns/init.lua +++ b/mods/ITEMS/mcl_lanterns/init.lua @@ -1,5 +1,5 @@ -local S = minetest.get_translator("mcl_lanterns") -local modpath = minetest.get_modpath("mcl_lanterns") +local S = minetest.get_translator(minetest.get_current_modname()) +local modpath = minetest.get_modpath(minetest.get_current_modname()) mcl_lanterns = {} diff --git a/mods/ITEMS/mcl_lanterns/local/mcl_lanterns.fr.tr b/mods/ITEMS/mcl_lanterns/local/mcl_lanterns.fr.tr new file mode 100644 index 000000000..c653a8faf --- /dev/null +++ b/mods/ITEMS/mcl_lanterns/local/mcl_lanterns.fr.tr @@ -0,0 +1,6 @@ +# textdomain: mcl_lanterns +Chain=Chaine +Chains are metallic decoration blocks.=Les chaines sont des blocs de décoration métalliques. +Lantern=Lanterne +Lanterns are light sources which can be placed on the top or the bottom of most blocks.=Les lanternes sont des sources de lumières qui peuvent être placées au sommet ou en-dessous de la plupart des blocs. +Soul Lantern=Lanterne des âmes diff --git a/mods/ITEMS/mcl_lanterns/local/template.txt b/mods/ITEMS/mcl_lanterns/local/template.txt new file mode 100644 index 000000000..765de8747 --- /dev/null +++ b/mods/ITEMS/mcl_lanterns/local/template.txt @@ -0,0 +1,6 @@ +# textdomain: mcl_lanterns +Chain= +Chains are metallic decoration blocks.= +Lantern= +Lanterns are light sources which can be placed on the top or the bottom of most blocks.= +Soul Lantern= diff --git a/mods/ITEMS/mcl_lanterns/register.lua b/mods/ITEMS/mcl_lanterns/register.lua index 7cf03d0d5..fcffbdcb8 100644 --- a/mods/ITEMS/mcl_lanterns/register.lua +++ b/mods/ITEMS/mcl_lanterns/register.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_lanterns") +local S = minetest.get_translator(minetest.get_current_modname()) mcl_lanterns.register_lantern("lantern", { description = S("Lantern"), diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index a7b04d3d4..a7ce53720 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -321,7 +321,7 @@ minetest.register_tool("mcl_mobitems:carrot_on_a_stick", { _tt_help = S("Lets you ride a saddled pig"), _doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them."), _doc_items_usagehelp = S("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."), - wield_image = "mcl_mobitems_carrot_on_a_stick.png", + wield_image = "mcl_mobitems_carrot_on_a_stick.png^[transformFY^[transformR90", inventory_image = "mcl_mobitems_carrot_on_a_stick.png", groups = { transport = 1 }, _mcl_toollike_wield = true, diff --git a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png index ee7b5af7f..e24f624c4 100644 Binary files a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png and b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png differ diff --git a/mods/ITEMS/mcl_mushroom/init.lua b/mods/ITEMS/mcl_mushroom/init.lua index a1a2f45c2..774ea577c 100644 --- a/mods/ITEMS/mcl_mushroom/init.lua +++ b/mods/ITEMS/mcl_mushroom/init.lua @@ -3,7 +3,7 @@ local S = minetest.get_translator("mcl_mushroom") -- function grow() function grow_twisting_vines(pos, moreontop) local y = pos.y + 1 - while not (moreontop == 0) do + 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_mushroom:twisting_vines"}) moreontop = moreontop - 1 @@ -13,18 +13,18 @@ function grow_twisting_vines(pos, moreontop) else moreontop = 0 end - end + end end -- Warped fungus -- Crimson fungus ---Functions and Biomes +-- Functions and Biomes -- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german minetest.register_node("mcl_mushroom:warped_fungus", { - description = S("Warped Fungus Mushroom"), + description = S("Warped Fungus Mushroom"), drawtype = "plantlike", tiles = { "farming_warped_fungus.png" }, inventory_image = "farming_warped_fungus.png", @@ -32,8 +32,7 @@ minetest.register_node("mcl_mushroom:warped_fungus", { 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,deco_block=1}, - + groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, compostability=65}, light_source = 1, selection_box = { type = "fixed", @@ -43,22 +42,22 @@ minetest.register_node("mcl_mushroom:warped_fungus", { on_rightclick = function(pos, node, pointed_thing, itemstack) if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then - itemstack:take_item() - local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) - if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then + itemstack:take_item() + local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) + if nodepos.name == "mcl_mushroom: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, - stack_max = 64, + end + end + end, + _mcl_blast_resistance = 0, + stack_max = 64, }) minetest.register_node("mcl_mushroom:twisting_vines", { - description = S("Twisting Vines"), + description = S("Twisting Vines"), drawtype = "plantlike", tiles = { "twisting_vines_plant.png" }, inventory_image = "twisting_vines.png", @@ -67,7 +66,7 @@ minetest.register_node("mcl_mushroom:twisting_vines", { 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}, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1, compostability=50}, selection_box = { type = "fixed", fixed = { -3/16, -0.5, -3/16, 3/16, 0.5, 3/16 }, @@ -92,15 +91,15 @@ minetest.register_node("mcl_mushroom:twisting_vines", { _mcl_shears_drop = true, _mcl_silk_touch_drop = true, _mcl_fortune_drop = { items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 3},}, - items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 1.8181818181818181},}, - "mcl_mushroom:twisting_vines", - "mcl_mushroom:twisting_vines"}, - _mcl_blast_resistance = 0, - stack_max = 64, + items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 1.8181818181818181},}, + "mcl_mushroom:twisting_vines", + "mcl_mushroom:twisting_vines"}, + _mcl_blast_resistance = 0, + stack_max = 64, }) minetest.register_node("mcl_mushroom:nether_sprouts", { - description = S("Nether Sprouts"), + description = S("Nether Sprouts"), drawtype = "plantlike", tiles = { "nether_sprouts.png" }, inventory_image = "nether_sprouts.png", @@ -108,7 +107,7 @@ minetest.register_node("mcl_mushroom:nether_sprouts", { 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}, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1, compostability=50}, selection_box = { type = "fixed", fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, @@ -117,12 +116,12 @@ minetest.register_node("mcl_mushroom:nether_sprouts", { drop = "", _mcl_shears_drop = true, _mcl_silk_touch_drop = false, - _mcl_blast_resistance = 0, - stack_max = 64, + _mcl_blast_resistance = 0, + stack_max = 64, }) minetest.register_node("mcl_mushroom:warped_roots", { - description = S("Warped Roots"), + description = S("Warped Roots"), drawtype = "plantlike", tiles = { "warped_roots.png" }, inventory_image = "warped_roots.png", @@ -130,111 +129,114 @@ minetest.register_node("mcl_mushroom:warped_roots", { 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}, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1, compostability=65}, 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, - stack_max = 64, + _mcl_blast_resistance = 0, + stack_max = 64, }) minetest.register_node("mcl_mushroom:warped_wart_block", { - description = S("Warped Wart Block"), - tiles = {"warped_wart_block.png"}, - groups = {handy=1,hoe=7,swordy=1, deco_block=1, }, - stack_max = 64, - _mcl_hardness = 2, + description = S("Warped Wart Block"), + tiles = {"warped_wart_block.png"}, + groups = {handy=1,hoe=7,swordy=1, compostability=85, deco_block=1, }, + stack_max = 64, + _mcl_hardness = 2, }) minetest.register_node("mcl_mushroom:shroomlight", { - description = S("Shroomlight"), - tiles = {"shroomlight.png"}, - groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, }, - stack_max = 64, - _mcl_hardness = 2, - -- this is 15 in Minecraft - light_source = 14, + description = S("Shroomlight"), + tiles = {"shroomlight.png"}, + groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, compostability=65, }, + stack_max = 64, + _mcl_hardness = 2, + -- this is 15 in Minecraft + light_source = 14, }) minetest.register_node("mcl_mushroom:warped_hyphae", { - description = S("Warped Hyphae"), - tiles = {"warped_hyphae.png", - "warped_hyphae.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - }, - groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, + description = S("Warped Hyphae"), + tiles = { + "warped_hyphae.png", + "warped_hyphae.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + }, + groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 2, }) minetest.register_node("mcl_mushroom: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", - }, - groups = {pickaxey=1, building_block=1, material_stone=1}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 0.4, - _mcl_blast_resistance = 0.4, - is_ground_content = true, - drop = "mcl_nether:netherrack", - _mcl_silk_touch_drop = true, + 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", + }, + groups = {pickaxey=1, building_block=1, material_stone=1}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + is_ground_content = true, + drop = "mcl_nether:netherrack", + _mcl_silk_touch_drop = true, }) minetest.register_node("mcl_mushroom:warped_checknode", { - description = S("Warped Checknode - only to check!"), - tiles = {"mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - }, - groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 0.4, - _mcl_blast_resistance = 0.4, - is_ground_content = true, - drop = "mcl_nether:netherrack" + description = S("Warped Checknode - only to check!"), + tiles = { + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + }, + groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + is_ground_content = true, + drop = "mcl_nether:netherrack" }) minetest.register_node("mcl_mushroom: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", - stack_max = 64, - _mcl_hardness = 2, + 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", + stack_max = 64, + _mcl_hardness = 2, }) -mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab")) +mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"), "woodlike") minetest.register_craft({ - output = "mcl_mushroom:warped_hyphae_wood 4", - recipe = { - {"mcl_mushroom:warped_hyphae"}, - } + output = "mcl_mushroom:warped_hyphae_wood 4", + recipe = { + {"mcl_mushroom:warped_hyphae"}, + } }) minetest.register_craft({ - output = "mcl_mushroom:warped_nylium 2", - recipe = { - {"mcl_mushroom:warped_wart_block"}, - {"mcl_nether:netherrack"}, - } + output = "mcl_mushroom:warped_nylium 2", + recipe = { + {"mcl_mushroom:warped_wart_block"}, + {"mcl_nether:netherrack"}, + } }) minetest.register_abm({ @@ -245,42 +247,41 @@ minetest.register_abm({ action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then - if pos.y < -28400 then - generate_warped_tree(pos) - end + if pos.y < -28400 then + generate_warped_tree(pos) + end end - end + end }) minetest.register_abm({ label = "mcl_mushroom:warped_checknode", nodenames = {"mcl_mushroom:warped_checknode"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) if nodepos.name == "air" then - minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" }) - local randomg = math.random(1, 400) - if randomg <= 5 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) - elseif randomg > 5 and randomg <= 15 then - local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } - generate_warped_tree(pos1) - elseif randomg > 15 and randomg <= 45 then - grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4)) - elseif randomg > 45 and randomg <= 50 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) - elseif randomg > 50 and randomg <= 150 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" }) - elseif randomg > 150 and randomg <= 250 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" }) - end - + minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" }) + local randomg = math.random(1, 400) + if randomg <= 5 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) + elseif randomg > 5 and randomg <= 15 then + local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } + generate_warped_tree(pos1) + elseif randomg > 15 and randomg <= 45 then + grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4)) + elseif randomg > 45 and randomg <= 50 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) + elseif randomg > 50 and randomg <= 150 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" }) + elseif randomg > 150 and randomg <= 250 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" }) + end else - minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) + minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) end - end + end }) @@ -297,7 +298,7 @@ minetest.register_abm({ minetest.register_node("mcl_mushroom:crimson_fungus", { - description = S("Crimson Fungus Mushroom"), + description = S("Crimson Fungus Mushroom"), drawtype = "plantlike", tiles = { "farming_crimson_fungus.png" }, inventory_image = "farming_crimson_fungus.png", @@ -305,8 +306,7 @@ minetest.register_node("mcl_mushroom:crimson_fungus", { 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}, - + 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, compostability=65}, light_source = 1, selection_box = { type = "fixed", @@ -315,23 +315,22 @@ minetest.register_node("mcl_mushroom:crimson_fungus", { node_placement_prediction = "", on_rightclick = function(pos, node, pointed_thing, itemstack) if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then - itemstack:take_item() - local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) - if nodepos.name == "mcl_mushroom: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 + itemstack:take_item() + local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) + if nodepos.name == "mcl_mushroom: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, + end, _mcl_blast_resistance = 0, - - stack_max = 64, + stack_max = 64, }) minetest.register_node("mcl_mushroom:crimson_roots", { - description = S("Crimson Roots"), + description = S("Crimson Roots"), drawtype = "plantlike", tiles = { "crimson_roots.png" }, inventory_image = "crimson_roots.png", @@ -339,94 +338,97 @@ minetest.register_node("mcl_mushroom:crimson_roots", { 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}, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1, compostability=65}, 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, - stack_max = 64, + _mcl_blast_resistance = 0, + stack_max = 64, }) minetest.register_node("mcl_mushroom:crimson_hyphae", { - description = S("Crimson Hyphae"), - tiles = {"crimson_hyphae.png", - "crimson_hyphae.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - }, - groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, + description = S("Crimson Hyphae"), + tiles = { + "crimson_hyphae.png", + "crimson_hyphae.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + }, + groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 2, }) minetest.register_node("mcl_mushroom: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", - stack_max = 64, - _mcl_hardness = 2, + 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", + stack_max = 64, + _mcl_hardness = 2, }) minetest.register_node("mcl_mushroom: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", - stack_max = 64, - _mcl_hardness = 0.4, - _mcl_blast_resistance = 0.4, - is_ground_content = true, - drop = "mcl_nether:netherrack", - _mcl_silk_touch_drop = true, + 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", + stack_max = 64, + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + is_ground_content = true, + drop = "mcl_nether:netherrack", + _mcl_silk_touch_drop = true, }) minetest.register_node("mcl_mushroom:crimson_checknode", { - description = S("Crimson Checknode - only to check!"), - tiles = {"mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - "mcl_nether_netherrack.png", - }, - groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 0.4, - _mcl_blast_resistance = 0.4, - is_ground_content = true, - drop = "mcl_nether:netherrack" + description = S("Crimson Checknode - only to check!"), + tiles = { + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png", + }, + groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + is_ground_content = true, + drop = "mcl_nether:netherrack" }) minetest.register_craft({ - output = "mcl_mushroom:crimson_hyphae_wood 4", - recipe = { - {"mcl_mushroom:crimson_hyphae"}, - } + output = "mcl_mushroom:crimson_hyphae_wood 4", + recipe = { + {"mcl_mushroom:crimson_hyphae"}, + } }) minetest.register_craft({ - output = "mcl_mushroom:crimson_nylium 2", - recipe = { - {"mcl_nether:nether_wart"}, - {"mcl_nether:netherrack"}, - } + output = "mcl_mushroom:crimson_nylium 2", + recipe = { + {"mcl_nether:nether_wart"}, + {"mcl_nether:netherrack"}, + } }) -mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab") +mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab", "woodlike") minetest.register_abm({ label = "mcl_mushroom:crimson_fungus", @@ -436,191 +438,219 @@ minetest.register_abm({ action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then - if pos.y < -28400 then - generate_crimson_tree(pos) - end + if pos.y < -28400 then + generate_crimson_tree(pos) + end end - end + end }) minetest.register_abm({ label = "mcl_mushroom:crimson_checknode", nodenames = {"mcl_mushroom:crimson_checknode"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) if nodepos.name == "air" then - minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" }) - local randomg = math.random(1, 400) - if randomg <= 10 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) - elseif randomg > 10 and randomg <= 25 then - local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } - generate_crimson_tree(pos1) - elseif randomg > 25 and randomg <= 30 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) - elseif randomg > 30 and randomg <= 130 then - minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" }) - end + minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" }) + local randomg = math.random(1, 400) + if randomg <= 10 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) + elseif randomg > 10 and randomg <= 25 then + local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } + generate_crimson_tree(pos1) + elseif randomg > 25 and randomg <= 30 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) + elseif randomg > 30 and randomg <= 130 then + minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" }) + end else - minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) + minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) end - end + end }) function generate_warped_tree(pos) local breakgrow = false local breakgrow2 = false - -- Baumgenerator - -- erste und zweite Etage + -- Tree generator + -- first and second layer for x = pos.x - 2,pos.x + 2 do - for y = pos.y + 3, pos.y + 4 do - for z = pos.z - 2, pos.z + 2 do - if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end - end + for y = pos.y + 3, pos.y + 4 do + for z = pos.z - 2, pos.z + 2 do + if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then + breakgrow = true + end end - end + end + end - -- dritte und vierte Etage + -- third and fourth layers for x = pos.x - 1,pos.x + 1 do - for y = pos.y + 5, pos.y + 6 do - for z = pos.z - 1, pos.z + 1 do - if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end - end - end - end + for y = pos.y + 5, pos.y + 6 do + for z = pos.z - 1, pos.z + 1 do + if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then + breakgrow = true + end + end + end + end - -- fünfte Etage - if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end + -- fifth layer + if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then + breakgrow = true + end - -- Holz - if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow = true end - for y = pos.y + 1, pos.y + 4 do - if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end - end - if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow2 = true end - if breakgrow == false then - -- Warzen - -- erste und zweite Etage - for x = pos.x - 2,pos.x + 2 do - for y = pos.y + 3, pos.y + 4 do - for z = pos.z - 2, pos.z + 2 do - minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) - end - end - end + -- Wood + if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then + breakgrow = true + end + for y = pos.y + 1, pos.y + 4 do + if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then + breakgrow = true + end + end + if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then + breakgrow2 = true + end + if breakgrow == false then + -- Warts + -- first and second layer + for x = pos.x - 2,pos.x + 2 do + for y = pos.y + 3, pos.y + 4 do + for z = pos.z - 2, pos.z + 2 do + minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) + end + end + end - -- dritte und vierte Etage - for x = pos.x - 1,pos.x + 1 do - for y = pos.y + 5, pos.y + 6 do - for z = pos.z - 1, pos.z + 1 do - minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) - end - end - end + -- third and fourth layers + for x = pos.x - 1,pos.x + 1 do + for y = pos.y + 5, pos.y + 6 do + for z = pos.z - 1, pos.z + 1 do + minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) + end + end + end - -- fünfte Etage - minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" }) + -- fifth layer + minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" }) - -- Pilzlich - local randomgenerate = math.random(1, 2) - if randomgenerate == 1 then - local randomx = math.random(-2, 2) - local randomz = math.random(-2, 2) - minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) - end - local randomgenerate = math.random(1, 8) - if randomgenerate == 4 then - local randomx = math.random(-2, 2) - local randomz = math.random(-2, 2) - minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) - end - -- Holz - for y = pos.y, pos.y + 4 do - minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" }) - --print("Placed at " .. x .. " " .. y .. " " .. z) - end - else - if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" }) end - end + -- Fungal + local randomgenerate = math.random(1, 2) + if randomgenerate == 1 then + local randomx = math.random(-2, 2) + local randomz = math.random(-2, 2) + minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) + end + local randomgenerate = math.random(1, 8) + if randomgenerate == 4 then + local randomx = math.random(-2, 2) + local randomz = math.random(-2, 2) + minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) + end + -- Wood + for y = pos.y, pos.y + 4 do + minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" }) + --print("Placed at " .. x .. " " .. y .. " " .. z) + end + else + if breakgrow2 == false then + minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" }) + end + end end function generate_crimson_tree(pos) local breakgrow = false local breakgrow2 = false - -- Baumgenerator - -- erste und zweite Etage + -- Tree generator + -- first and second layer for x = pos.x - 2,pos.x + 2 do - for y = pos.y + 3, pos.y + 4 do - for z = pos.z - 2, pos.z + 2 do - if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end - end + for y = pos.y + 3, pos.y + 4 do + for z = pos.z - 2, pos.z + 2 do + if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then + breakgrow = true + end end - end + end + end - -- dritte und vierte Etage + -- third and fourth layers for x = pos.x - 1,pos.x + 1 do - for y = pos.y + 5, pos.y + 6 do - for z = pos.z - 1, pos.z + 1 do - if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end - end - end - end + for y = pos.y + 5, pos.y + 6 do + for z = pos.z - 1, pos.z + 1 do + if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then + breakgrow = true + end + end + end + end - -- fünfte Etage - if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end + -- fifth layer + if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then + breakgrow = true + end - -- Holz - if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow = true end - for y = pos.y + 1, pos.y + 4 do - if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end - end - if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow2 = true end - if breakgrow == false then - -- Warzen - -- erste und zweite Etage - for x = pos.x - 2,pos.x + 2 do - for y = pos.y + 3, pos.y + 4 do - for z = pos.z - 2, pos.z + 2 do - minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) - end - end - end + -- Wood + if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then + breakgrow = true + end + for y = pos.y + 1, pos.y + 4 do + if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then + breakgrow = true + end + end + if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then + breakgrow2 = true + end + if breakgrow == false then + -- Warts + -- first and second layer + for x = pos.x - 2,pos.x + 2 do + for y = pos.y + 3, pos.y + 4 do + for z = pos.z - 2, pos.z + 2 do + minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) + end + end + end - -- dritte und vierte Etage - for x = pos.x - 1,pos.x + 1 do - for y = pos.y + 5, pos.y + 6 do - for z = pos.z - 1, pos.z + 1 do - minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) - end - end - end + -- third and fourth layers + for x = pos.x - 1,pos.x + 1 do + for y = pos.y + 5, pos.y + 6 do + for z = pos.z - 1, pos.z + 1 do + minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) + end + end + end - -- fünfte Etage - minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" }) + -- fifth layer + minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" }) - -- Pilzlich - local randomgenerate = math.random(1, 2) - if randomgenerate == 1 then - local randomx = math.random(-2, 2) - local randomz = math.random(-2, 2) - minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) - end - local randomgenerate = math.random(1, 8) - if randomgenerate == 4 then - local randomx = math.random(-2, 2) - local randomz = math.random(-2, 2) - minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) - end - -- Holz - for y = pos.y, pos.y + 4 do - minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" }) - --print("Placed at " .. x .. " " .. y .. " " .. z) - end - else - if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) end - end + -- Fungal + local randomgenerate = math.random(1, 2) + if randomgenerate == 1 then + local randomx = math.random(-2, 2) + local randomz = math.random(-2, 2) + minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) + end + local randomgenerate = math.random(1, 8) + if randomgenerate == 4 then + local randomx = math.random(-2, 2) + local randomz = math.random(-2, 2) + minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) + end + -- Wood + for y = pos.y, pos.y + 4 do + minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" }) + --print("Placed at " .. x .. " " .. y .. " " .. z) + end + else + if breakgrow2 == false then + minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) + end + end end @@ -662,45 +692,45 @@ minetest.register_decoration({ }) ]] minetest.register_ore({ - ore_type = "sheet", - ore = "mcl_mushroom:warped_checknode", - -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally - -- in v6, but instead set with the on_generated function in mcl_mapgen_core. - wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, - clust_scarcity = 14 * 14 * 14, - clust_size = 10, - y_min = -29065, - y_max = -28940, - noise_threshold = 0.0, - noise_params = { - offset = 0.5, - scale = 0.1, - spread = {x = 8, y = 8, z = 8}, - seed = 4996, - octaves = 1, - persist = 0.0 - }, + ore_type = "sheet", + ore = "mcl_mushroom:warped_checknode", + -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally + -- in v6, but instead set with the on_generated function in mcl_mapgen_core. + wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, + clust_scarcity = 14 * 14 * 14, + clust_size = 10, + y_min = -29065, + y_max = -28940, + noise_threshold = 0.0, + noise_params = { + offset = 0.5, + scale = 0.1, + spread = {x = 8, y = 8, z = 8}, + seed = 4996, + octaves = 1, + persist = 0.0 + }, }) minetest.register_ore({ - ore_type = "sheet", - ore = "mcl_mushroom:crimson_checknode", - -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally - -- in v6, but instead set with the on_generated function in mcl_mapgen_core. - wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, - clust_scarcity = 10 * 10 * 10, - clust_size = 10, - y_min = -29065, - y_max = -28940, - noise_threshold = 0.0, - noise_params = { - offset = 1, - scale = 0.5, - spread = {x = 12, y = 12, z = 12}, - seed = 12948, - octaves = 1, - persist = 0.0 - }, + ore_type = "sheet", + ore = "mcl_mushroom:crimson_checknode", + -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally + -- in v6, but instead set with the on_generated function in mcl_mapgen_core. + wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, + clust_scarcity = 10 * 10 * 10, + clust_size = 10, + y_min = -29065, + y_max = -28940, + noise_threshold = 0.0, + noise_params = { + offset = 1, + scale = 0.5, + spread = {x = 12, y = 12, z = 12}, + seed = 12948, + octaves = 1, + persist = 0.0 + }, }) diff --git a/mods/ITEMS/mcl_mushrooms/huge.lua b/mods/ITEMS/mcl_mushrooms/huge.lua index 617f12810..83bc6a910 100644 --- a/mods/ITEMS/mcl_mushrooms/huge.lua +++ b/mods/ITEMS/mcl_mushrooms/huge.lua @@ -3,7 +3,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) local vector = vector local template = { - groups = {handy=1,axey=1, building_block = 1, material_wood = 1, flammable = -1 }, + groups = {handy=1,axey=1, building_block = 1, material_wood = 1, flammable = -1, compostability=85 }, sounds = mcl_sounds.node_sound_wood_defaults(), is_ground_content = true, _mcl_blast_resistance = 0.2, @@ -51,6 +51,7 @@ local function register_mushroom(color, species_id, template, d_cap, d_stem, d_s stem_full.tiles = { "mcl_mushrooms_mushroom_block_skin_stem.png" } stem_full.groups.huge_mushroom = species_id stem_full.groups.huge_mushroom_stem = 2 + stem_full.groups.compostability=65 minetest.register_node("mcl_mushrooms:"..color.."_mushroom_block_stem_full", stem_full) -- Stem @@ -60,6 +61,7 @@ local function register_mushroom(color, species_id, template, d_cap, d_stem, d_s stem.tiles = { "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_skin_stem.png" } stem.groups.huge_mushroom = species_id stem.groups.huge_mushroom_stem = 1 + stem.groups.compostability=65 minetest.register_node("mcl_mushrooms:"..color.."_mushroom_block_stem", stem) -- Mushroom block (cap) diff --git a/mods/ITEMS/mcl_mushrooms/small.lua b/mods/ITEMS/mcl_mushrooms/small.lua index c6d7edcdc..6fdc80c16 100644 --- a/mods/ITEMS/mcl_mushrooms/small.lua +++ b/mods/ITEMS/mcl_mushrooms/small.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_mushrooms:mushroom_brown", { 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}, + 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, compostability=65}, sounds = mcl_sounds.node_sound_leaves_defaults(), light_source = 1, selection_box = { @@ -62,7 +62,7 @@ minetest.register_node("mcl_mushrooms:mushroom_red", { 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}, + 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, compostability=65}, sounds = mcl_sounds.node_sound_leaves_defaults(), selection_box = { type = "fixed", diff --git a/mods/ITEMS/mcl_nether/README.txt b/mods/ITEMS/mcl_nether/README.txt new file mode 100644 index 000000000..8deac79a9 --- /dev/null +++ b/mods/ITEMS/mcl_nether/README.txt @@ -0,0 +1,3 @@ +Mod mcl_nether : basic nether blocs, forked from Mineclone 2 + +Texture of mcl_nether_netheritebloc.png from PixelPerfection Legacy by XSSheep edited by Nova_Wostra (CC-BY-SA 4.0) \ No newline at end of file diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 2d6fbcecc..d5201e682 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -77,8 +77,7 @@ minetest.register_node("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 + _mcl_silk_touch_drop = true }) -- For eternal fire on top of netherrack and magma blocks @@ -202,7 +201,7 @@ minetest.register_node("mcl_nether:nether_wart_block", { stack_max = 64, tiles = {"mcl_nether_nether_wart_block.png"}, is_ground_content = false, - groups = {handy=1, hoey=1, building_block=1}, + groups = {handy=1, hoey=1, building_block=1, compostability=85}, sounds = mcl_sounds.node_sound_leaves_defaults( { footstep={name="default_dirt_footstep", gain=0.7}, diff --git a/mods/ITEMS/mcl_nether/nether_wart.lua b/mods/ITEMS/mcl_nether/nether_wart.lua index 90af6bdd6..e7452a211 100644 --- a/mods/ITEMS/mcl_nether/nether_wart.lua +++ b/mods/ITEMS/mcl_nether/nether_wart.lua @@ -150,7 +150,7 @@ minetest.register_craftitem("mcl_nether:nether_wart_item", { end end end, - groups = { craftitem = 1, brewitem=1 }, + groups = { craftitem = 1, brewitem=1, compostability=30 }, }) local names = {"mcl_nether:nether_wart_0", "mcl_nether:nether_wart_1", "mcl_nether:nether_wart_2"} diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png index 60957f017..5b08c3d03 100644 Binary files a/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png 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 422f475ac..fbdb12448 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -741,7 +741,7 @@ minetest.register_craftitem("mcl_ocean:kelp", { inventory_image = "mcl_ocean_kelp_item.png", wield_image = "mcl_ocean_kelp_item.png", on_place = kelp.kelp_on_place, - groups = { deco_block = 1 }, + groups = { deco_block = 1, compostability=30 }, }) if mod_doc then @@ -756,7 +756,7 @@ minetest.register_craftitem("mcl_ocean:dried_kelp", { _doc_items_longdesc = S("Dried kelp is a food item."), inventory_image = "mcl_ocean_dried_kelp.png", wield_image = "mcl_ocean_dried_kelp.png", - groups = { food = 2, eatable = 1 }, + groups = { food = 2, eatable = 1, compostability=30 }, on_place = minetest.item_eat(1), on_secondary_use = minetest.item_eat(1), _mcl_saturation = 0.6, @@ -773,7 +773,7 @@ minetest.register_node("mcl_ocean:dried_kelp_block", { description = S("Dried Kelp Block"), _doc_items_longdesc = S("A decorative block that serves as a great furnace fuel."), tiles = { "mcl_ocean_dried_kelp_top.png", "mcl_ocean_dried_kelp_bottom.png", "mcl_ocean_dried_kelp_side.png" }, - groups = { handy = 1, hoey = 1, building_block = 1, flammable = 2, fire_encouragement = 30, fire_flammability = 60 }, + groups = { handy = 1, hoey = 1, building_block = 1, flammable = 2, fire_encouragement = 30, fire_flammability = 60, compostability=50 }, sounds = mcl_sounds.node_sound_leaves_defaults(), paramtype2 = "facedir", on_place = mcl_util.rotate_axis, diff --git a/mods/ITEMS/mcl_ocean/sea_pickle.lua b/mods/ITEMS/mcl_ocean/sea_pickle.lua index d215fd3b3..435dc10f0 100644 --- a/mods/ITEMS/mcl_ocean/sea_pickle.lua +++ b/mods/ITEMS/mcl_ocean/sea_pickle.lua @@ -106,7 +106,7 @@ for s=1,4 do }, inventory_image = img, wield_image = img, - groups = { dig_immediate = 3, deco_block = 1, sea_pickle=1, not_in_creative_inventory=nici }, + groups = { dig_immediate = 3, deco_block = 1, sea_pickle=1, not_in_creative_inventory=nici, compostability=65 }, -- Light level: 6 at size 1, +3 for each additional stage light_source = math.min(6 + (s-1)*3, minetest.LIGHT_MAX), selection_box = { diff --git a/mods/ITEMS/mcl_ocean/seagrass.lua b/mods/ITEMS/mcl_ocean/seagrass.lua index 5fd382775..52c506f81 100644 --- a/mods/ITEMS/mcl_ocean/seagrass.lua +++ b/mods/ITEMS/mcl_ocean/seagrass.lua @@ -85,7 +85,7 @@ minetest.register_craftitem("mcl_ocean:seagrass", { inventory_image = "mcl_ocean_seagrass.png^[verticalframe:12:0", wield_image = "mcl_ocean_seagrass.png^[verticalframe:12:0", on_place = seagrass_on_place, - groups = { deco_block = 1 }, + groups = { deco_block = 1, compostability=30 }, }) -- Seagrass nodes: seagrass on a surface node diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index 9e1a67a75..3e4f5ba12 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -235,6 +235,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 @@ -243,8 +244,9 @@ end minetest.register_abm({ label = "End portal teleportation", nodenames = {"mcl_portals:portal_end"}, - interval = 0.1, + interval = 1, chance = 1, + -- TODO: Move to playerinfo/playerplus/mob api action = mcl_portals.end_portal_teleport, }) diff --git a/mods/ITEMS/mcl_portals/portal_gateway.lua b/mods/ITEMS/mcl_portals/portal_gateway.lua index 505935105..4d79dce53 100644 --- a/mods/ITEMS/mcl_portals/portal_gateway.lua +++ b/mods/ITEMS/mcl_portals/portal_gateway.lua @@ -106,9 +106,10 @@ local function teleport(pos, obj) end minetest.register_abm({ + -- TODO: Move to playerinfo/playerplus/mob api label = "End gateway portal teleportation", nodenames = {"mcl_portals:portal_gateway"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) if preparing[minetest.pos_to_string(pos)] then return end diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 7390bbb2f..a8fdc51b2 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -729,8 +729,8 @@ mcl_structures.register_structure({name = "nether_portal", place_function = mcl_ minetest.register_abm({ label = "Nether portal teleportation and particles", nodenames = {PORTAL}, - interval = 0.8, - chance = 3, + interval = 1, + chance = 2, action = function(pos, node) -- Don't use call stack! local upper_node_name = get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name @@ -811,6 +811,7 @@ minetest.register_abm({ }) end end + -- TODO: Move to playerinfo/playerplus/mob api for _, obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do --maikerumine added for objects to travel local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel if (obj:is_player() or lua_entity) and prevent_portal_chatter(obj) then diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 56a3cfe11..8ad8700f0 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -22,6 +22,10 @@ local OCEAN_MIN = -15 local DEEP_OCEAN_MAX = OCEAN_MIN - 1 local DEEP_OCEAN_MIN = -31 +local minetest_get_perlin = minetest.get_perlin +local math_floor = math.floor +local math_abs = math.abs + --[[ Special biome field: _mcl_biome_type: Rough categorization of biomes: One of "snowy", "cold", "medium" and "hot" Based off ]] @@ -3922,6 +3926,16 @@ local function register_decorations() end -- Decorations in non-Overworld dimensions + +local chorus_noise_params = { + offset = -0.012, + scale = 0.024, + spread = {x = 100, y = 100, z = 100}, + seed = 257, + octaves = 3, + persistence = 0.6, +} + local function register_dimension_decorations() --[[ NETHER ]] -- TODO: Nether @@ -3935,14 +3949,7 @@ local function register_dimension_decorations() place_on = {"mcl_end:end_stone", "air"}, flags = "all_floors", sidelen = 16, - noise_params = { - offset = -0.012, - scale = 0.024, - spread = {x = 100, y = 100, z = 100}, - seed = 257, - octaves = 3, - persist = 0.6 - }, + noise_params = chorus_noise_params, y_min = mcl_mapgen.end_.min, y_max = mcl_mapgen.end_.max, decoration = "mcl_end:chorus_flower", @@ -3962,6 +3969,8 @@ end -- Detect mapgen to select functions -- +local chorus_perlin_noise + if not mcl_mapgen.singlenode then if not superflat then if not mcl_mapgen.v6 then @@ -3994,8 +4003,10 @@ if not mcl_mapgen.singlenode then vm_context.gennotify = vm_context.gennotify or minetest.get_mapgen_object("gennotify") local gennotify = vm_context.gennotify for _, pos in pairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do + chorus_perlin_noise = chorus_perlin_noise or minetest_get_perlin(chorus_noise_params) local realpos = { x = pos.x, y = pos.y + 1, z = pos.z } - local pr = PseudoRandom(vm_context.blockseed) + local noise = chorus_perlin_noise:get_3d(realpos) + local pr = PseudoRandom(math_floor(math_abs(noise * 32767)) % 32768) minetest.after(1, mcl_end.grow_chorus_plant, realpos, false, pr) end return vm_context @@ -4003,4 +4014,3 @@ if not mcl_mapgen.singlenode then end end - diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 14acf7106..448e75c41 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -75,6 +75,7 @@ local function spawnstruct_function(name, param) local pos = player:get_pos() if not pos then return end + pos.y = math.floor(pos.y) + 1 local pr = PseudoRandom(math.floor(pos.x * 333 + pos.y * 19 - pos.z + 4)) pos = vector.round(pos) local dir = minetest.yaw_to_dir(player:get_look_horizontal()) diff --git a/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr b/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr new file mode 100644 index 000000000..86b7d1b33 --- /dev/null +++ b/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_villages +Chiseled Stone Village Bricks=Pierre sculptée du village +Map chunk @1 to @2 is not suitable for placing villages.=La partie de la carte de @1 à @2 n'est pas propice au placement d'un village. diff --git a/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr b/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr index 1223c24ec..f9a1fa064 100644 --- a/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr +++ b/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr @@ -21,6 +21,10 @@ Ban list: @1=Liste d'interdiction: @1 Show who is logged on=Afficher qui est connecté Displays the world seed=Affiche la graine du monde Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisés! -@1[]=@1[] +@1[]=@1[] Set game mode for player or yourself=Choisir le mode de jeu pour vous ou pour les joueurs Error: No game mode specified.=Erreur : mode de jeu non spécifié. + = +Play a sound. Arguments: : name of the sound. : Target.=Jouer un son. Arguments: : nom d'un son. : Cible. +Sound name is invalid!=Le nom du son est invalide ! +Target is invalid!!=La cible est invalide ! diff --git a/mods/MISC/mcl_commands/summon.lua b/mods/MISC/mcl_commands/summon.lua index 69da0a66c..2a2792f5f 100644 --- a/mods/MISC/mcl_commands/summon.lua +++ b/mods/MISC/mcl_commands/summon.lua @@ -3,13 +3,41 @@ local S = minetest.get_translator(minetest.get_current_modname()) local orig_func = minetest.registered_chatcommands["spawnentity"].func local cmd = table.copy(minetest.registered_chatcommands["spawnentity"]) cmd.func = function(name, param) - local ent = minetest.registered_entities[param] - if minetest.settings:get_bool("only_peaceful_mobs", false) and ent and ent._cmi_is_mob and ent.type == "monster" then - return false, S("Only peaceful mobs allowed!") - else - local bool, msg = orig_func(name, param) - return bool, msg + local params = param:split(" ") + if not params[1] or params[3] then + return false, S("Usage: /spawnentity [,,]") end + local entity_name = params[1] + local pos = params[2] + local entity_def = minetest.registered_entities[entity_name] + if not entity_def then + entity_name = "mobs_mc:" .. entity_name + entity_def = minetest.registered_entities[entity_name] + if not entity_def then + return false, S("Error: Unknown entity name") + end + end + if entity_def._cmi_is_mob then + if minetest.settings:get_bool("only_peaceful_mobs", false) and entity_def.type == "monster" then + return false, S("Only peaceful mobs allowed!") + end + mobs.spawn_mob( + entity_name, + pos + and minetest.string_to_pos(pos) + or vector.add( + minetest.get_player_by_name(name):get_pos(), + { + x = math.random()-0.5, + y = math.random(), + z = math.random()-0.5 + } + ) + ) + return true, S("Mob @1 spawned", entity_name) + end + local bool, msg = orig_func(name, param) + return bool, msg end minetest.unregister_chatcommand("spawnentity") minetest.register_chatcommand("summon", cmd) \ No newline at end of file diff --git a/mods/PLAYER/mcl_antispam/init.lua b/mods/PLAYER/mcl_antispam/init.lua new file mode 100644 index 000000000..11431d5ba --- /dev/null +++ b/mods/PLAYER/mcl_antispam/init.lua @@ -0,0 +1,112 @@ +local ban_spammers = true +local kick_spammers = true +local revoke_shout_for_spammers = true +local limit_messages = 10 +local limit_message_length = 200 +local block_special_chars = true +local enable_antispam = ban_spammers or kick_spammers or revoke_shout_for_spammers + +local function update_settings() + ban_spammers = minetest.settings:get_bool("ban_spammers", true) + kick_spammers = minetest.settings:get_bool("kick_spammers", true) + revoke_shout_for_spammers = minetest.settings:get_bool("revoke_shout_for_spammers", true) + limit_messages = tonumber(minetest.settings:get("limit_messages") or 10) + limit_message_length = tonumber(minetest.settings:get("limit_message_length") or 200) + block_special_chars = minetest.settings:get_bool("block_special_chars", true) + enable_antispam = ban_spammers or kick_spammers or revoke_shout_for_spammers + minetest.after(7, update_settings) +end +update_settings() + +local last_messages = {} +local exceeders = {} +local special_users = {} + +local function ban(name) + if revoke_shout_for_spammers then + local privs = minetest.get_player_privs(name) + if privs then + privs.shout = nil + minetest.set_player_privs(name, privs) + end + end + if ban_spammers then + minetest.ban_player(name) + elseif kick_spammers then + minetest.kick_player(name) + end +end + +local last_char = string.char(127) + +local function on_chat_message(name, message) + if not enable_antispam then return end + local length = message:len() + if last_messages.job then + last_messages.job:cancel() + last_messages.job = nil + end + if last_messages.name and last_messages.name == name then + last_messages.count = last_messages.count + 1 + last_messages.summary_length = last_messages.summary_length + length + if last_messages.count >= limit_messages then + ban(name) + end + else + last_messages.name = name + last_messages.count = 1 + last_messages.summary_length = length + end + last_messages.job = minetest.after(30, function() + last_messages.name = nil + last_messages.job = nil + end) + if limit_message_length > 0 and message:len() > limit_message_length then + if exceeders[name] then + exceeders[name] = exceeders[name] + 1 + if exceeders[name] > limit_messages then + ban(name) + end + else + exceeders[name] = 1 + end + message = message:sub(1, limit_message_length) .. ">8 >8 >8" + minetest.chat_send_all("<" .. name .. "> " .. message) + return true + else + if exceeders[name] then + exceeders[name] = nil + end + end + if block_special_chars then + local sc = false + local msg = "" + for i = 1, #message do + local c = message:sub(i,i) + if c >= " " and c <= last_char then + msg = msg .. c + else + sc = true + end + end + if sc then + if special_users[name] then + special_users[name] = special_users[name] + 1 + if special_users[name] > limit_messages then + ban(name) + end + else + special_users[name] = 1 + end + message = msg + minetest.chat_send_all("<" .. name .. "> " .. message) + return true + else + if special_users[name] then + special_users[name] = nil + end + end + end +end + +minetest.register_on_chat_message(on_chat_message) diff --git a/mods/PLAYER/mcl_antispam/mod.conf b/mods/PLAYER/mcl_antispam/mod.conf new file mode 100644 index 000000000..ef259eab0 --- /dev/null +++ b/mods/PLAYER/mcl_antispam/mod.conf @@ -0,0 +1,2 @@ +name = mcl_antispam +author = kay27 diff --git a/mods/PLAYER/mcl_death_drop/init.lua b/mods/PLAYER/mcl_death_drop/init.lua index bfeee0c3e..5ea548ecc 100644 --- a/mods/PLAYER/mcl_death_drop/init.lua +++ b/mods/PLAYER/mcl_death_drop/init.lua @@ -1,56 +1,57 @@ -local random = math.random - -local ipairs = ipairs - -mcl_death_drop = {} - -mcl_death_drop.registered_dropped_lists = {} - -function mcl_death_drop.register_dropped_list(inv, listname, drop) - table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop}) -end - -mcl_death_drop.register_dropped_list("PLAYER", "main", true) -mcl_death_drop.register_dropped_list("PLAYER", "craft", true) -mcl_death_drop.register_dropped_list("PLAYER", "armor", true) - -minetest.register_on_dieplayer(function(player) - local keep = minetest.settings:get_bool("mcl_keepInventory", false) - if keep == false then - -- Drop inventory, crafting grid and armor - local playerinv = player:get_inventory() - local pos = player:get_pos() - -- No item drop if in deep void - local _, void_deadly = mcl_worlds.is_in_void(pos) - - for l=1,#mcl_death_drop.registered_dropped_lists do - local inv = mcl_death_drop.registered_dropped_lists[l].inv - if inv == "PLAYER" then - inv = playerinv - elseif type(inv) == "function" then - inv = inv(player) - end - local listname = mcl_death_drop.registered_dropped_lists[l].listname - local drop = mcl_death_drop.registered_dropped_lists[l].drop - if inv then - for i, stack in ipairs(inv:get_list(listname)) do - local x = random(0, 9)/3 - local z = random(0, 9)/3 - pos.x = pos.x + x - pos.z = pos.z + z - if not void_deadly and drop and not mcl_enchanting.has_enchantment(stack, "curse_of_vanishing") then - local def = minetest.registered_items[stack:get_name()] - if def and def.on_drop then - stack = def.on_drop(stack, player, pos) - end - minetest.add_item(pos, stack) - end - pos.x = pos.x - x - pos.z = pos.z - z - end - inv:set_list(listname, {}) - end - end - mcl_armor.update(player) - end -end) +local random = math.random + +local ipairs = ipairs + +mcl_death_drop = {} + +mcl_death_drop.registered_dropped_lists = {} + +function mcl_death_drop.register_dropped_list(inv, listname, drop) + table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop}) +end + +mcl_death_drop.register_dropped_list("PLAYER", "main", true) +mcl_death_drop.register_dropped_list("PLAYER", "craft", true) +mcl_death_drop.register_dropped_list("PLAYER", "armor", true) +mcl_death_drop.register_dropped_list("PLAYER", "offhand", true) + +minetest.register_on_dieplayer(function(player) + local keep = minetest.settings:get_bool("mcl_keepInventory", false) + if keep == false then + -- Drop inventory, crafting grid and armor + local playerinv = player:get_inventory() + local pos = player:get_pos() + -- No item drop if in deep void + local _, void_deadly = mcl_worlds.is_in_void(pos) + + for l=1,#mcl_death_drop.registered_dropped_lists do + local inv = mcl_death_drop.registered_dropped_lists[l].inv + if inv == "PLAYER" then + inv = playerinv + elseif type(inv) == "function" then + inv = inv(player) + end + local listname = mcl_death_drop.registered_dropped_lists[l].listname + local drop = mcl_death_drop.registered_dropped_lists[l].drop + if inv then + for i, stack in ipairs(inv:get_list(listname)) do + local x = random(0, 9)/3 + local z = random(0, 9)/3 + pos.x = pos.x + x + pos.z = pos.z + z + if not void_deadly and drop and not mcl_enchanting.has_enchantment(stack, "curse_of_vanishing") then + local def = minetest.registered_items[stack:get_name()] + if def and def.on_drop then + stack = def.on_drop(stack, player, pos) + end + minetest.add_item(pos, stack) + end + pos.x = pos.x - x + pos.z = pos.z - z + end + inv:set_list(listname, {}) + end + end + mcl_armor.update(player) + end +end) diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 4e2316cd7..62b9ddd4c 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -113,10 +113,6 @@ function mcl_player.player_set_armor(player, texture, preview) set_preview(player, "armor", preview) end -function mcl_player.player_set_wielditem(player, texture) - set_texture(player, 3, texture) -end - function mcl_player.player_get_preview(player) local preview = player:get_meta():get_string("mcl_player:skin_preview") if preview == "" then diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 26d1320c7..885594f0f 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -329,15 +329,17 @@ minetest.register_globalstep(function(dtime) end if wielded_def and wielded_def._mcl_toollike_wield then - set_bone_position_conditional(player,"Wield_Item", vector.new(0,3.9,1.3), vector.new(90,0,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,4.7,3.1), vector.new(-90,225,90)) elseif string.find(wielded:get_name(), "mcl_bows:bow") then - set_bone_position_conditional(player,"Wield_Item", vector.new(.5,4.5,-1.6), vector.new(90,0,20)) + set_bone_position_conditional(player,"Wield_Item", vector.new(1,4,0), vector.new(90,130,115)) elseif string.find(wielded:get_name(), "mcl_bows:crossbow_loaded") then - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(64,90,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.2,1.2), vector.new(0,180,73)) elseif string.find(wielded:get_name(), "mcl_bows:crossbow") then - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(90,90,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.2,1.2), vector.new(0,180,45)) + elseif wielded_def.inventory_image == "" then + set_bone_position_conditional(player,"Wield_Item", vector.new(0,6,2), vector.new(180,-45,0)) else - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,4.9,1.8), vector.new(135,0,90)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.3,2), vector.new(90,0,0)) end -- controls right and left arms pitch when shooting a bow or blocking diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index de4db5094..ca6aa97b1 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -452,10 +452,60 @@ function mcl_spawn.get_player_spawn_pos(player) if bgroup ~= 1 and bgroup ~= 2 then -- Bed is destroyed: if player and player:is_player() then - player:get_meta():set_string("mcl_beds:spawn", "") + + local function split(s, delimiter) --this is just a common function to split strings, since it is way harder to do in lua like in python, java etc. + result = {}; + for match in (s..delimiter):gmatch("(.-)"..delimiter) do + table.insert(result, match); + end + return result; + end + s = split(player:get_meta():get_string("mcl_beds:spawn"), ",") + x = nil + y = nil + z = nil + for key, value in pairs(s) do + if key == 1 then + value = value:sub(2) + x = tonumber(value) + else + if key == 2 then + y = tonumber(value) + else + if key == 3 then + value = value:sub(1, -2) + z = tonumber(value) + end + end + end + end + + checkblock = {x = x, y = y, z = z} + + if minetest.get_node(checkblock).name == "mcl_beds:respawn_anchor_charged_1" then + minetest.set_node(checkblock, {name="mcl_beds:respawn_anchor"}) + player:set_pos(checkblock) + else + if minetest.get_node(checkblock).name == "mcl_beds:respawn_anchor_charged_2" then + minetest.set_node(checkblock, {name="mcl_beds:respawn_anchor_charged_1"}) + player:set_pos(checkblock) + else + if minetest.get_node(checkblock).name == "mcl_beds:respawn_anchor_charged_3" then + minetest.set_node(checkblock, {name="mcl_beds:respawn_anchor_charged_2"}) + player:set_pos(checkblock) + else + if minetest.get_node(checkblock).name == "mcl_beds:respawn_anchor_charged_4" then + minetest.set_node(checkblock, {name="mcl_beds:respawn_anchor_charged_3"}) + player:set_pos(checkblock) + else + player:get_meta():set_string("mcl_beds:spawn", "") + minetest.chat_send_player(player:get_player_name(), S("Your spawn bed was missing or blocked, and you had no charged respawn anchor")) + return mcl_spawn.get_world_spawn_pos(), false + end + end + end + end end - minetest.chat_send_player(player:get_player_name(), S("Your spawn bed was missing or blocked.")) - return mcl_spawn.get_world_spawn_pos(), false end -- Find spawning position on/near the bed free of solid or damaging blocks iterating a square spiral 15x15: @@ -531,4 +581,4 @@ minetest.after(respawn_search_initial_delay, function() storage:set_int("mcl_spawn_dir_step", dir_step) storage:set_int("mcl_spawn_dir_ind", dir_ind) end) -end) +end) \ No newline at end of file diff --git a/mods/PLAYER/mcl_wieldview/README.txt b/mods/PLAYER/mcl_wieldview/README.txt index 183e8c6d5..b118d9ba6 100644 --- a/mods/PLAYER/mcl_wieldview/README.txt +++ b/mods/PLAYER/mcl_wieldview/README.txt @@ -3,19 +3,8 @@ Makes hand wielded items visible to other players. -default settings: [minetest.conf] - -# Set number of seconds between visible wielded item updates. -wieldview_update_time = 2 - -# Show nodes as tiles, disabled by default -wieldview_node_tiles = false - Info for modders ################ -Wield image transformation: To apply a simple transformation to the item in -hand, add the group “wieldview_transform” to the item definition. The group -rating equals one of the numbers used for the [transform texture modifier -of the Lua API. +Add items to the "no_wieldview" group with a raiting of 1 and it will not be shown by the wieldview. diff --git a/mods/PLAYER/mcl_wieldview/init.lua b/mods/PLAYER/mcl_wieldview/init.lua index 92175a17e..660f5edb3 100644 --- a/mods/PLAYER/mcl_wieldview/init.lua +++ b/mods/PLAYER/mcl_wieldview/init.lua @@ -1,131 +1,47 @@ -local get_connected_players = minetest.get_connected_players local get_item_group = minetest.get_item_group -mcl_wieldview = { - players = {} -} - -function mcl_wieldview.get_item_texture(itemname) - if itemname == "" or minetest.get_item_group(itemname, "no_wieldview") ~= 0 then - return - end - - local def = minetest.registered_items[itemname] - if not def then - return - end - - local inv_image = def.inventory_image - if inv_image == "" then - return - end - - local texture = inv_image - - local transform = get_item_group(itemname, "wieldview_transform") - if transform then - -- This actually works with groups ratings because transform1, transform2, etc. - -- have meaning and transform0 is used for identidy, so it can be ignored - texture = texture .. "^[transform" .. transform - end - - return texture -end - -function mcl_wieldview.update_wielded_item(player) - if not player then - return - end - local itemstack = player:get_wielded_item() - local itemname = itemstack:get_name() - - local def = mcl_wieldview.players[player] - - if def and (def.item == itemname) then - return - end - - local texture = mcl_wieldview.get_item_texture(itemname) or "blank.png" - - local new_def = { - item = itemname, - texture = texture, - } - mcl_wieldview.players[player] = new_def - - mcl_player.player_set_wielditem(player, texture) -end - minetest.register_on_joinplayer(function(player) - mcl_wieldview.players[player] = {item = "", texture = "blank.png"} - - minetest.after(0, function() - if not player:is_player() then - return - end - - mcl_wieldview.update_wielded_item(player) - - local itementity = minetest.add_entity(player:get_pos(), "mcl_wieldview:wieldnode") - itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45)) - itementity:get_luaentity().wielder = player - end) -end) - -minetest.register_on_leaveplayer(function(player) - mcl_wieldview.players[player] = nil -end) - -minetest.register_globalstep(function() - local players = get_connected_players() - for i = 1, #players do - mcl_wieldview.update_wielded_item(players[i]) + if not player or not player:is_player() then + return end + local itementity = minetest.add_entity(player:get_pos(), "mcl_wieldview:wieldnode") + if not itementity then return end + itementity:set_attach(player, "Wield_Item", vector.new(0, 0, 0), vector.new(0, 0, 0)) + --itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 45, 90)) + itementity:get_luaentity()._wielder = player end) minetest.register_entity("mcl_wieldview:wieldnode", { - initial_properties = { - hp_max = 1, - visual = "wielditem", - physical = false, - textures = {""}, - automatic_rotate = 1.5, - is_visible = true, - pointable = false, - collide_with_objects = false, - static_save = false, - collisionbox = {-0.21, -0.21, -0.21, 0.21, 0.21, 0.21}, - selectionbox = {-0.21, -0.21, -0.21, 0.21, 0.21, 0.21}, - visual_size = {x = 0.21, y = 0.21}, - }, + visual = "wielditem", + physical = false, + pointable = false, + collide_with_objects = false, + static_save = false, + visual_size = {x = 0.21, y = 0.21}, - itemstring = "", + _item = "", on_step = function(self) - if self.wielder:is_player() then - local def = mcl_wieldview.players[self.wielder] - local itemstring = def.item - - if self.itemstring ~= itemstring then - local itemdef = minetest.registered_items[itemstring] - self.object:set_properties({glow = itemdef and itemdef.light_source or 0}) - - -- wield item as cubic - if def.texture == "blank.png" then - self.object:set_properties({textures = {itemstring}}) - -- wield item as flat - else - self.object:set_properties({textures = {""}}) - end - - if minetest.get_item_group(itemstring, "no_wieldview") ~= 0 then - self.object:set_properties({textures = {""}}) - end - - self.itemstring = itemstring - end - else + if not self._wielder or not self._wielder:is_player() then self.object:remove() end + local player = self._wielder + + local item = player:get_wielded_item():get_name() + + if item == self._item then return end + + self._item = item + + if get_item_group(item, "no_wieldview") ~= 0 then + item = "" + end + + local item_def = minetest.registered_items[item] + self.object:set_properties({ + glow = item_def and item_def.light_source or 0, + wield_item = item, + is_visible = item ~= "" + }) end, }) diff --git a/mods/PLAYER/mcl_wieldview/mod.conf b/mods/PLAYER/mcl_wieldview/mod.conf index 4b3097876..7ed41eeb4 100644 --- a/mods/PLAYER/mcl_wieldview/mod.conf +++ b/mods/PLAYER/mcl_wieldview/mod.conf @@ -1,4 +1,4 @@ name = mcl_wieldview author = stujones11 description = Makes hand wielded items visible to other players. -depends = mcl_player +depends = mcl_armor, mcl_playerplus diff --git a/settingtypes.txt b/settingtypes.txt index dca03b7e1..0587438da 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -51,6 +51,10 @@ mcl_showDeathMessages (Show death messages) bool true # If disabled, all recipes will be shown. mcl_craftguide_progressive_mode (Learn crafting recipes progressively) bool true +# Limit the number of sparks produced by lava per 5 seconds to this number. +# 0 will disable lava sparks altogeter with no ABM being registered. +mcl_core_lava_spark_limit (Number of sparks lava can produce per 5 seconds) int 10 + [Mobs] # If enabled, mobs will spawn naturally. This does not affect # affect mob spawners. @@ -165,6 +169,20 @@ kick_cheaters (Kick Cheaters) bool false # Cheat kicking threshold kick_threshold (Cheat Kicking Threshold) int 10 +[Antispam] +# Maximum player messages in a sequence +limit_messages (Maximum player messages in a sequence) int 10 +# Maximum message length +limit_message_length (Maximum message length) int 200 +# Block special characters +block_special_chars (Block special characters) bool true +# Ban spammers +ban_spammers (Ban spammers) bool true +# Kick spammers +kick_spammers (Kick spammers) bool true +# Revoke shout priv for spammers +revoke_shout_for_spammers (Revoke shout priv for spammers) bool true + [Debugging] # If enabled, this will show the itemstring of an item in the description. mcl_item_id_debug (Item ID Debug) bool false diff --git a/tools/create_texture__mcl_end_crystal_beam.py b/tools/create_texture__mcl_end_crystal_beam.py new file mode 100644 index 000000000..ab2166714 --- /dev/null +++ b/tools/create_texture__mcl_end_crystal_beam.py @@ -0,0 +1,28 @@ +import png +from random import randrange + +w, h = 16, 256; + +s = [[int(0) for c in range(w)] for c in range(h)] + +def drawpixel(x, y, t): + if (x >= 0) and (x < w) and (y >= 0) and (y < h): + s[y][x] = t + +# R, G, B, Alpha (0xFF = opaque): +palette=[ + (0x00,0x00,0x00,0x00), + (0xFF,0xFF,0x70,0xCC), + (0xFF,0x80,0xDF,0xCC), + (0x80,0xFF,0xDF,0xCC) +] + +for x in range(w): + for y in range(h): + n = randrange(4) + if n == 1: + drawpixel(x, y, randrange(3) + 1) + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=2) +f = open('mcl_end_crystal_beam.png', 'wb') +w.write(f, s)