From 59b6385d107119f8de5f88a911a3adad705f29e8 Mon Sep 17 00:00:00 2001 From: David McMackins II Date: Tue, 17 Mar 2020 15:00:12 -0500 Subject: [PATCH 01/18] Fix bug where powered rails would not accelerate a fueled minecart --- mods/ENTITIES/mcl_minecarts/init.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 7c57334be3..d23e8ad0b4 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -409,14 +409,17 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o -- Slow down or speed up local acc = dir.y * -1.8 - + local friction = 0.4 local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration + + acc = acc - friction + if has_fuel then - acc = acc + 0.2 - elseif speed_mod and speed_mod ~= 0 then - acc = acc + speed_mod - else - acc = acc - 0.4 + acc = acc + 0.6 + end + + if speed_mod and speed_mod ~= 0 then + acc = acc + speed_mod + friction end new_acc = vector.multiply(dir, acc) From 21c68158394165033aed64d71fc309ed92fbee45 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 25 Jul 2020 13:32:35 +0200 Subject: [PATCH 02/18] Added End Crystal --- mods/ENTITIES/mobs_mc/ender_dragon.lua | 17 +-- mods/ITEMS/mcl_bows/arrow.lua | 4 +- mods/ITEMS/mcl_end/end_crystal.lua | 114 ++++++++++++++++++ mods/ITEMS/mcl_end/init.lua | 3 + mods/ITEMS/mcl_end/locale/mcl_end.de.tr | 5 + mods/ITEMS/mcl_end/locale/template.txt | 5 + mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d | Bin 0 -> 12932 bytes mods/ITEMS/mcl_end/models/mcl_end_crystal.png | Bin 0 -> 1940 bytes .../mcl_end/textures/mcl_end_crystal_item.png | Bin 0 -> 356 bytes mods/ITEMS/mcl_throwing/init.lua | 12 +- 10 files changed, 146 insertions(+), 14 deletions(-) create mode 100644 mods/ITEMS/mcl_end/end_crystal.lua create mode 100644 mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d create mode 100644 mods/ITEMS/mcl_end/models/mcl_end_crystal.png create mode 100644 mods/ITEMS/mcl_end/textures/mcl_end_crystal_item.png diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index c9da0c4988..71627aadad 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -39,12 +39,6 @@ mobs:register_mob("mobs_mc:enderdragon", { dogshoot_count2_max = 5, passive = false, attack_animals = true, - drops = { - {name = mobs_mc.items.dragon_egg, - chance = 1, - min = 1, - max = 1}, - }, lava_damage = 0, fire_damage = 0, on_rightclick = nil, @@ -58,8 +52,17 @@ mobs:register_mob("mobs_mc:enderdragon", { walk_start = 0, walk_end = 20, run_start = 0, run_end = 20, }, - ignores_nametag = true, + on_die = function(self, own_pos) + if self._egg_spawn_pos then + local pos = minetest.string_to_pos(self._egg_spawn_pos) + --if minetest.get_node(pos).buildable_to then + minetest.set_node(pos, {name = mobs_mc.items.dragon_egg}) + return + --end + end + minetest.add_item(own_pos, mobs_mc.items.dragon_egg) + end }) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index ad65eb1226..45cc3e6219 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -174,7 +174,7 @@ ARROW_ENTITY.on_step = function(self, dtime) if obj ~= self._shooter and obj:is_player() then ok = true elseif obj:get_luaentity() ~= nil then - if obj ~= self._shooter and obj:get_luaentity()._cmi_is_mob then + if obj ~= self._shooter and (obj:get_luaentity()._cmi_is_mob or obj:get_luaentity()._hittable_by_projectile) then ok = true end end @@ -196,7 +196,7 @@ ARROW_ENTITY.on_step = function(self, dtime) local obj = closest_object local is_player = obj:is_player() local lua = obj:get_luaentity() - if obj ~= self._shooter and (is_player or (lua and lua._cmi_is_mob)) then + if obj ~= self._shooter and (is_player or (lua and (lua._cmi_is_mob or lua._hittable_by_projectile))) then if obj:get_hp() > 0 then -- Check if there is no solid node between arrow and object local ray = minetest.raycast(self.object:get_pos(), obj:get_pos(), true) diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua new file mode 100644 index 0000000000..50d3312a8d --- /dev/null +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -0,0 +1,114 @@ +local S = minetest.get_translator("mcl_end") + +local explosion_strength = 6 + +local directions = { + {x = 1}, {x = -1}, {z = 1}, {z = -1} +} + +local dimensions = {"x", "y", "z"} + +for _, dir in pairs(directions) do + for _, dim in pairs(dimensions) do + dir[dim] = dir[dim] or 0 + end +end + +local function find_crystal(pos) + local objects = minetest.get_objects_inside_radius(pos, 0) + for _, obj in pairs(objects) do + local luaentity = obj:get_luaentity() + if luaentity and luaentity.name == "mcl_end:crystal" then + return luaentity + end + end +end + +local function crystal_explode(self, puncher) + if self._exploded then return end + self._exploded = true + local strength = puncher and explosion_strength or 1 + mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 1}, puncher) + minetest.after(0, self.object.remove, self.object) +end + +local function set_crystal_animation(self) + self.object:set_animation({x = 0, y = 60}, 30) +end + +local function spawn_crystal(pos) + local crystal = minetest.add_entity(pos, "mcl_end:crystal") + if not vector.equals(pos, vector.floor(pos)) then return end + if mcl_worlds.pos_to_dimension(pos) ~= "end" then return end + local portal_center + for _, dir in pairs(directions) do + local node = minetest.get_node(vector.add(pos, dir)) + if node.name == "mcl_portals:portal_end" then + portal_center = vector.add(pos, vector.multiply(dir, 3)) + break + end + end + if not portal_center then return end + local crystals = {} + for i, dir in pairs(directions) do + local crystal_pos = vector.add(portal_center, vector.multiply(dir, 3)) + crystals[i] = find_crystal(crystal_pos) + if not crystals[i] then return end + end + for _, crystal in pairs(crystals) do + crystal_explode(crystal) + end + local dragon = minetest.add_entity(vector.add(portal_center, {x = 0, y = 10, z = 0}), "mobs_mc:enderdragon") + dragon:get_luaentity()._egg_spawn_pos = minetest.pos_to_string(vector.add(portal_center, {x = 0, y = 4, z = 0})) +end + +minetest.register_entity("mcl_end:crystal", { + initial_properties = { + physical = true, + visual = "mesh", + visual_size = {x = 7.5, y = 7.5, z = 7.5}, + collisionbox = {-1, 0.5, -1, 1, 2.5, 1}, + mesh = "mcl_end_crystal.b3d", + textures = {"mcl_end_crystal.png"}, + collide_with_objects = true, + }, + on_punch = crystal_explode, + on_activate = set_crystal_animation, + _exploded = false, + _hittable_by_projectile = true +}) + +minetest.register_craftitem("mcl_end:crystal", { + inventory_image = "mcl_end_crystal_item.png", + description = S("End Crystal"), + stack_max = 64, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" then + local pos = minetest.get_pointed_thing_position(pointed_thing) + local node = minetest.get_node(pos).name + if find_crystal(pos) then return itemstack end + if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then + if not minetest.is_creative_enabled(placer:get_player_name()) then + itemstack:take_item() + end + spawn_crystal(pos) + end + end + return itemstack + end, + _tt_help = S("Ignited by a punch or a hit with an arrow").."\n"..S("Explosion radius: @1", tostring(explosion_strength)), + _doc_items_longdesc = S("End Crystals are explosive devices. They can be placed on Obsidian or Bedrock. Ignite them by a punch or a hit with an arrow. End Crystals can also be used the spawn the Ender Dragon by placing one at each side of the End Exit Portal."), + _doc_items_usagehelp = S("Place the End Crystal on Obsidian or Bedrock, then punch it or hit it with an arrow to cause an huge and probably deadly explosion. To Spawn the Ender Dragon, place one at each side of the End Exit Portal."), + +}) + +minetest.register_craft({ + output = "mcl_end:crystal", + recipe = { + {"mcl_core:glass", "mcl_core:glass", "mcl_core:glass"}, + {"mcl_core:glass", "mcl_end:ender_eye", "mcl_core:glass"}, + {"mcl_core:glass", "mcl_mobitems:ghast_tear", "mcl_core:glass"}, + } +}) + +minetest.register_alias("mcl_end_crystal:end_crystal", "mcl_end:crystal") diff --git a/mods/ITEMS/mcl_end/init.lua b/mods/ITEMS/mcl_end/init.lua index e3ca8a86b3..2adcd7cf8d 100644 --- a/mods/ITEMS/mcl_end/init.lua +++ b/mods/ITEMS/mcl_end/init.lua @@ -4,3 +4,6 @@ local basepath = minetest.get_modpath(minetest.get_current_modname()) dofile(basepath.."/chorus_plant.lua") dofile(basepath.."/building.lua") dofile(basepath.."/eye_of_ender.lua") +if not minetest.get_modpath("mcl_end_crystal") then + dofile(basepath.."/end_crystal.lua") +end diff --git a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr index df3ad90f2d..3914c2a987 100644 --- a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr +++ b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr @@ -26,3 +26,8 @@ The stem attaches itself to end stone and other chorus blocks.=Der Stängel muss Grows on end stone=Wächst auf Endstein Randomly teleports you when eaten=Zufällige Teleportation, wenn gegessen Guides the way to the mysterious End dimension=Weist den Weg zur mysteriösen Endedimension +End Crystal=Enderkristall +End Crystals are explosive devices. They can be placed on Obsidian or Bedrock. Ignite them by a punch or a hit with an arrow. End Crystals can also be used the spawn the Ender Dragon by placing one at each side of the End Exit Portal.=Enderkristalle sind explosiv. Sie können auf Obsidian oder Grundgestein platziert werden. Man kann sie durch einen Schlag oder einen Treffer mit einem Pfeil entzünden. Ausserdem können sie benutzt werden, um den Enderdrachen zu erzeugen, in dem man je einen auf jeder Seite des Endausgangsportals platziert. +Explosion radius: @1=Explosionsradius: @1 +Ignited by a punch or a hit with an arrow=Entzündbar durch einen Schlag oder einen Treffer mit einem Pfeil +Place the End Crystal on Obsidian or Bedrock, then punch it or hit it with an arrow to cause an huge and probably deadly explosion. To Spawn the Ender Dragon, place one at each side of the End Exit Portal.=Platziere den Enderkistall auf Obsidian oder Grundgestein, dann schlage ihn oder triff ihn mit einem Pfeil, um eine riesige und meistens tödliche Explosion zu bewirken. diff --git a/mods/ITEMS/mcl_end/locale/template.txt b/mods/ITEMS/mcl_end/locale/template.txt index 3f024383e8..08c7de07b8 100644 --- a/mods/ITEMS/mcl_end/locale/template.txt +++ b/mods/ITEMS/mcl_end/locale/template.txt @@ -26,3 +26,8 @@ The stem attaches itself to end stone and other chorus blocks.= Grows on end stone= Randomly teleports you when eaten= Guides the way to the mysterious End dimension= +End Crystal= +End Crystals are explosive devices. They can be placed on Obsidian or Bedrock. Ignite them by a punch or a hit with an arrow. End Crystals can also be used the spawn the Ender Dragon by placing one at each side of the End Exit Portal.= +Explosion radius: @1= +Ignited by a punch or a hit with an arrow= +Place the End Crystal on Obsidian or Bedrock, then punch it or hit it with an arrow to cause an huge and probably deadly explosion. To Spawn the Ender Dragon, place one at each side of the End Exit Portal.= diff --git a/mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d b/mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d new file mode 100644 index 0000000000000000000000000000000000000000..803bf99336149d7be36a2af547ff810a03f10947 GIT binary patch literal 12932 zcmds+eT-Jc6~>1zsR-B>5D+YjfKud31&XkHXIWT+NY2%%pHp=IUgR?XBpwYP5H_LZ5lXJ4*;iD#N2bReA8 zvV6so)&=U}Yuj&|xqide^_$ul=~4du@%rHPt*e&)dWgBXapme&L(etWETF&Iysz%8 zb=>??@%Vs=@jE*{TN^Rp#p2}7Q-uzxNl`m?qVt3O18d7){p-Ou+P5^yxQ?#&_Cp8F zzZ84NKGpg2rOy^}ikWQj0(*P>~dU)1-DGbX%J z==`0s0fZM@unNY9tAkMXoWC7%!e)BcuxzBYf={*}MqA^eB(^{4saU&;Q4 z^nT@^zpbyFU*^9Lex~&ueC>~2&$R51gHE6Bn)>pH+JRSo5UJT4tjBoKV_e4?()g4o zht{6|{hmUfPvh&RPo>V|QuG*4{_}Xv{7X^pe_h>w-1WvD)|dR|_34Nl8yZ49Z)Be=wPvhP1Xa39Ah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Ho!y@jllc2PR*TIk-Jd)ilv4DdFiqj$X$5yBa;`ylJjk>#F3pY~n1jQroP${}Vmh xeEt-*AL*2r7j}3M{Y{$v%G}9vm%j&|lCD-xbX2K0wioDI22WQ%mvv4FO#oU3igy42 literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_throwing/init.lua b/mods/ITEMS/mcl_throwing/init.lua index 58399a29d6..e46055e8a0 100644 --- a/mods/ITEMS/mcl_throwing/init.lua +++ b/mods/ITEMS/mcl_throwing/init.lua @@ -157,7 +157,7 @@ local check_object_hit = function(self, pos, dmg) -- TODO: Deal knockback self.object:remove() return true - elseif entity._cmi_is_mob == true and (self._thrower ~= object) then + elseif (entity._cmi_is_mob == true or entity._hittable_by_projectile) and (self._thrower ~= object) then -- FIXME: Knockback is broken object:punch(self.object, 1.0, { full_punch_interval = 1.0, @@ -196,22 +196,24 @@ end local snowball_on_step = function(self, dtime) self.timer=self.timer+dtime local pos = self.object:get_pos() + local vel = self.object:get_velocity() local node = minetest.get_node(pos) local def = minetest.registered_nodes[node.name] + -- Destroy when hitting a solid node if self._lastpos.x~=nil then if (def and def.walkable) or not def then - minetest.sound_play("mcl_throwing_snowball_impact_hard", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }, true) - snowball_particles(self._lastpos, self.object:get_velocity()) + minetest.sound_play("mcl_throwing_snowball_impact_hard", { pos = pos, max_hear_distance=16, gain=0.7 }, true) + snowball_particles(self._lastpos, vel) self.object:remove() return end end if check_object_hit(self, pos, {snowball_vulnerable = 3}) then - minetest.sound_play("mcl_throwing_snowball_impact_soft", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }, true) - snowball_particles(pos, self.object:get_velocity()) + minetest.sound_play("mcl_throwing_snowball_impact_soft", { pos = pos, max_hear_distance=16, gain=0.7 }, true) + snowball_particles(pos, vel) self.object:remove() return end From a31ed90a81869e287652fb951051a1dc94130e31 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 26 Jul 2020 13:28:13 +0200 Subject: [PATCH 03/18] Proper model --- mods/ITEMS/mcl_end/end_crystal.lua | 6 +++--- mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d | Bin 12932 -> 20852 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index 50d3312a8d..9872907f2b 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -28,12 +28,12 @@ local function crystal_explode(self, puncher) if self._exploded then return end self._exploded = true local strength = puncher and explosion_strength or 1 - mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 1}, puncher) + mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 0}, puncher) minetest.after(0, self.object.remove, self.object) end local function set_crystal_animation(self) - self.object:set_animation({x = 0, y = 60}, 30) + self.object:set_animation({x = 0, y = 120}, 25) end local function spawn_crystal(pos) @@ -66,7 +66,7 @@ minetest.register_entity("mcl_end:crystal", { initial_properties = { physical = true, visual = "mesh", - visual_size = {x = 7.5, y = 7.5, z = 7.5}, + visual_size = {x = 6, y = 6}, collisionbox = {-1, 0.5, -1, 1, 2.5, 1}, mesh = "mcl_end_crystal.b3d", textures = {"mcl_end_crystal.png"}, diff --git a/mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d b/mods/ITEMS/mcl_end/models/mcl_end_crystal.b3d index 803bf99336149d7be36a2af547ff810a03f10947..b6c2b9a3d9fefb019c65674128e188498869a1c5 100644 GIT binary patch literal 20852 zcmdtJcYICB8$W&{N{SSsiwM#LQEsrvnTbwB8WLH(vx4Y7IV_e%^uAh%=u)(mWG33i zDiMjc7OO0=Yh{&Ko$oy7%-nnK&Gq^H`}=<9<;l#s^PcxS^UO2lJojqXPTwIWT&J_r z>2&QPdiC&Qxl*1mdE!XFCQX{MXBnG{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qgd<@oULR$_BpkX_^VRbq4Okl)?^^a=W}i+V;uQI&i`bcBQME0qJ;j{`A*IwWvL^N%DJXYb>wF` zAC<|Dybs}|#g$JYhCbBfM1MC3?_4;)D@^NnPHX+>>-RvtPCm&mdubqvmcL50+*G3F zof0jllxX>)M9T#wTAnA-ayW^WpGmabOQPjf5-n$vX!(#t%XK7L9wX6m6p5C9NVMES zqU8+|Ehms@_q{~B%O%=9EivE0NkH>n`R+_Ynts0Xl8~mK@2VuI={N94OTIsnn5LiO zeiGC4bG%L>n|_Y7NmSF%@iB>Q`Z=y8aZNwRqa?cN=Qxr?HvRt>4OGED(N|6UgJ)hW zT=Zh$s}~EWy;ykf#d0>hSk8|Z%Ng@xIfq^>XVr`4JbSU6c`uf@kg!urW0xo-afjI9 z#S&kBSOTy;$O}7mEh+Vu|BkEE>p*skIXdo|^ zT)~S)19`FJ99}FM$crU+@nX?HUMx9K!j|W+qL6e4pn<$tG>{iN=Pa;jAg^CEkQa*v z@?z0IUMw2Oi$w!@v1lMK77gUZqJg|vG|(wcPBv`b+_p75+A*&P?+jb;-ky`s_*KwH z-{RN5p-(>#>LP-vAp3cczNw)9wqJtmXGGTbzo~*GnhKI=-*8Ce z$cse173B4c3i4u6L0&8>$cseLB`5P@$=keGayu`U b{LhOeNAzOJBfVI1O)r*w)Qcr&^ Date: Mon, 12 Oct 2020 11:07:11 +0200 Subject: [PATCH 04/18] Changed drop chance --- mods/ITEMS/mcl_end/end_crystal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index 9872907f2b..c07ff79306 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -28,7 +28,7 @@ local function crystal_explode(self, puncher) if self._exploded then return end self._exploded = true local strength = puncher and explosion_strength or 1 - mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 0}, puncher) + mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 1}, puncher) minetest.after(0, self.object.remove, self.object) end From d2518c91e8eabd353e3c3496a4629d24f0a1c4a2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 22:01:59 +0200 Subject: [PATCH 05/18] Tweak German End crystal translation --- mods/ITEMS/mcl_end/locale/mcl_end.de.tr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr index 3914c2a987..69a3408bb8 100644 --- a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr +++ b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr @@ -27,7 +27,7 @@ Grows on end stone=Wächst auf Endstein Randomly teleports you when eaten=Zufällige Teleportation, wenn gegessen Guides the way to the mysterious End dimension=Weist den Weg zur mysteriösen Endedimension End Crystal=Enderkristall -End Crystals are explosive devices. They can be placed on Obsidian or Bedrock. Ignite them by a punch or a hit with an arrow. End Crystals can also be used the spawn the Ender Dragon by placing one at each side of the End Exit Portal.=Enderkristalle sind explosiv. Sie können auf Obsidian oder Grundgestein platziert werden. Man kann sie durch einen Schlag oder einen Treffer mit einem Pfeil entzünden. Ausserdem können sie benutzt werden, um den Enderdrachen zu erzeugen, in dem man je einen auf jeder Seite des Endausgangsportals platziert. +End Crystals are explosive devices. They can be placed on Obsidian or Bedrock. Ignite them by a punch or a hit with an arrow. End Crystals can also be used the spawn the Ender Dragon by placing one at each side of the End Exit Portal.=Enderkristalle sind explosiv. Sie können auf Obsidian oder Grundgestein platziert werden. Man kann sie durch einen Schlag oder einen Treffer mit einem Pfeil entzünden. Außerdem können sie benutzt werden, um den Enderdrachen zu erzeugen, in dem man je einen auf jeder Seite des Endausgangsportals platziert. Explosion radius: @1=Explosionsradius: @1 Ignited by a punch or a hit with an arrow=Entzündbar durch einen Schlag oder einen Treffer mit einem Pfeil -Place the End Crystal on Obsidian or Bedrock, then punch it or hit it with an arrow to cause an huge and probably deadly explosion. To Spawn the Ender Dragon, place one at each side of the End Exit Portal.=Platziere den Enderkistall auf Obsidian oder Grundgestein, dann schlage ihn oder triff ihn mit einem Pfeil, um eine riesige und meistens tödliche Explosion zu bewirken. +Place the End Crystal on Obsidian or Bedrock, then punch it or hit it with an arrow to cause an huge and probably deadly explosion. To Spawn the Ender Dragon, place one at each side of the End Exit Portal.=Enderkistall auf Obsidian oder Grundgestein platzieren, dann Enderkristall schlagen oder mit einem Pfeil treffen. Dies bewirkt eine riesige und meistens tödliche Explosion. From 4ad1adb8506ba4629e71a1000992e5550d84ea70 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 22:13:55 +0200 Subject: [PATCH 06/18] Add 2mac to credits --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7b5762de8a..fda747a2a1 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ There are so many people to list (sorry). Check out the respective mod directori * MysticTempest: Bugfixes * [bzoss](https://github.com/bzoss): Status effects, potions, brewing stand * kay27 : Bugfixes, optimizations +* 2mac: Fix bug with powered rail * Lots of other people: TO BE WRITTEN (see mod directories for details) #### Mod credits (summary) From 3fde86eff6b6ea4d3cdd25b6455ce00040d88e5a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 22:50:53 +0200 Subject: [PATCH 07/18] Experience: Clean up HUD elements --- mods/HUD/mcl_experience/init.lua | 36 +++++++++----------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index bb62acbec2..07f2631a50 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -72,6 +72,7 @@ hud_manager.add_hud = function(player,hud_name,def) direction = def.direction, size = def.size, offset = def.offset, + z_index = def.z_index, }) -- create new 3d array here -- depends.txt is not needed @@ -144,16 +145,9 @@ function mcl_experience.set_player_xp_level(player,level) name = player:get_player_name() pool[name].level = level pool[name].xp = mcl_experience.level_to_xp(level) ---todo: update bar hud_manager.change_hud({ player = player, - hud_name = "xp_level_fg", - element = "text", - data = tostring(level) - }) - hud_manager.change_hud({ - player = player, - hud_name = "xp_level_bg", + hud_name = "xp_level", element = "text", data = tostring(level) }) @@ -174,7 +168,7 @@ minetest.register_on_joinplayer(function(player) name = "experience bar background", text = "experience_bar_background.png", number = 36, direction = 0, offset = {x = (-8 * 28) - 29, y = -(48 + 24 + 16)}, - size = { x=28, y=28 }, z_index = 3, + size = { x=28, y=28 }, z_index = 10, }) hud_manager.add_hud(player,"experience_bar", @@ -183,26 +177,18 @@ minetest.register_on_joinplayer(function(player) name = "experience bar", text = "experience_bar.png", number = temp_pool.bar, direction = 0, offset = {x = (-8 * 28) - 29, y = -(48 + 24 + 16)}, - size = { x=28, y=28 }, z_index = 4, + size = { x=28, y=28 }, z_index = 11, }) - hud_manager.add_hud(player,"xp_level_bg", + hud_manager.add_hud(player,"xp_level", { hud_elem_type = "text", position = {x=0.5, y=1}, - name = "xp_level_bg", text = tostring(temp_pool.level), - number = 0x000000, + name = "xp_level", text = tostring(temp_pool.level), + number = 0xFFFFFF, offset = {x = 0, y = -(48 + 24 + 24)}, - z_index = 5, + z_index = 12, }) - hud_manager.add_hud(player,"xp_level_fg", - { - hud_elem_type = "text", position = {x=0.5, y=1}, - name = "xp_level_fg", text = tostring(temp_pool.level), - number = 0xFFFFFF, - offset = {x = -1, y = -(48 + 24 + 25)}, - z_index = 6, - }) end) function mcl_experience.xp_to_level(xp) @@ -257,8 +243,7 @@ function mcl_experience.add_experience(player, experience) minetest.sound_play("level_up",{gain=0.2,to_player = name}) temp_pool.last_time = minetest.get_us_time()/1000000 end - hud_manager.change_hud({player = player, hud_name = "xp_level_fg", element = "text", data = tostring(temp_pool.level)}) - hud_manager.change_hud({player = player, hud_name = "xp_level_bg", element = "text", data = tostring(temp_pool.level)}) + hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) elseif minetest.get_us_time()/1000000 - temp_pool.last_time > 0.01 then temp_pool.last_time = minetest.get_us_time()/1000000 minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) @@ -286,8 +271,7 @@ minetest.register_on_dieplayer(function(player) temp_pool.level = 0 temp_pool.xp = 0 - hud_manager.change_hud({player = player, hud_name = "xp_level_fg", element = "text", data = tostring(temp_pool.level)}) - hud_manager.change_hud({player = player, hud_name = "xp_level_bg", element = "text", data = tostring(temp_pool.level)}) + hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) hud_manager.change_hud({player = player, hud_name = "experience_bar", element = "number", data = temp_pool.bar}) mcl_experience.throw_experience(player:get_pos(), xp_amount) From 53dbd4e2c2b8d76f21fc35e4e15dc966410193ec Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 22:58:13 +0200 Subject: [PATCH 08/18] Clean up /xp syntax help --- mods/HUD/mcl_experience/init.lua | 2 +- mods/HUD/mcl_experience/locale/mcl_experience.ru.tr | 2 +- mods/HUD/mcl_experience/locale/template.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index 07f2631a50..f0560ab7b5 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -472,7 +472,7 @@ minetest.register_entity("mcl_experience:orb", { minetest.register_chatcommand("xp", { params = S("[] []"), - description = S("Gives [[player ] ] XP"), + description = S("Gives a player some XP"), privs = {server=true}, func = function(name, params) local player, xp = nil, 1000 diff --git a/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr b/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr index 1d2195e8d3..72767125b3 100644 --- a/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr +++ b/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr @@ -1,5 +1,5 @@ [] []=[<игрок>] [] -Gives [[player ] ] XP=Даёт [[игроку <игрок> []] единиц опыта XP +Gives a player some XP= Error: Too many parameters!=Ошибка: слишком много параметров! Error: Incorrect value of XP=Ошибка: Недопустимое значение XP Error: Player not found=Ошибка: Игрок не найден diff --git a/mods/HUD/mcl_experience/locale/template.txt b/mods/HUD/mcl_experience/locale/template.txt index 963d9dffae..93c0f1bdb9 100644 --- a/mods/HUD/mcl_experience/locale/template.txt +++ b/mods/HUD/mcl_experience/locale/template.txt @@ -1,5 +1,5 @@ [] []= -Gives [[player ] ] XP= +Gives a player some XP= Error: Too many parameters!= Error: Incorrect value of XP= Error: Player not found= From 6706104c3aaba267b462f0be16b2331538d04fcf Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 23:00:54 +0200 Subject: [PATCH 09/18] Remove enchantment table --- mods/ITEMS/mcl_tools/enchanting.lua | 102 -------------------- mods/ITEMS/mcl_tools/init.lua | 1 - mods/ITEMS/mcl_tools/locale/mcl_tools.de.tr | 2 - mods/ITEMS/mcl_tools/locale/mcl_tools.es.tr | 2 - mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr | 2 - mods/ITEMS/mcl_tools/locale/mcl_tools.ru.tr | 2 - mods/ITEMS/mcl_tools/locale/template.txt | 2 - 7 files changed, 113 deletions(-) delete mode 100644 mods/ITEMS/mcl_tools/enchanting.lua diff --git a/mods/ITEMS/mcl_tools/enchanting.lua b/mods/ITEMS/mcl_tools/enchanting.lua deleted file mode 100644 index be01c18577..0000000000 --- a/mods/ITEMS/mcl_tools/enchanting.lua +++ /dev/null @@ -1,102 +0,0 @@ ---[[ -swiftness - how fast you mine -hardness - allows the tool to go way above it's level -durable - makes the tool last longer -slippery - you drop the tool randomly -careful - "not silk touch" -fortune - drops extra items and experience -autorepair - tool will repair itself randomly -spiky - the tool will randomly hurt you when used -sharpness - the tool does more damage -]]-- -local S = minetest.get_translator("mcl_tools") - -local enchantment_list = {"swiftness", "durable", "careful", "fortune", "autorepair", "sharpness"} - -local hexer = {"a","b","c","d","e","f","1","2","3","4","5","6","7","8","9","0"} -minetest.register_node("mcl_tools:enchantingtable", { - description = S("Enchanting Table"), - tiles = {"mcl_core_bedrock.png"}, - groups = {wood = 1, pathable = 1}, - sounds = mcl_sounds.node_sound_stone_defaults(), - is_ground_content = false, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - minetest.after(0,function(clicker) - local stack = clicker:get_wielded_item() - - local meta = stack:get_meta() - - if meta:get_string("enchanted") == "true" then return end - - if not minetest.registered_tools[itemstack:get_name()] then return end - - local tool_caps = itemstack:get_tool_capabilities() - local groupcaps = tool_caps.groupcaps - - if not groupcaps then return end - - local able_enchantments = table.copy(enchantment_list) - - - local player_level = mcl_experience.get_player_xp_level(clicker) - - local enchants_available = math.floor(player_level/5) - local max_enchant_level = math.floor(player_level/5) - if enchants_available <= 0 then return end - if enchants_available > 3 then enchants_available = 3 end - local stock_name = minetest.registered_tools[stack:get_name()].name - local description = minetest.registered_tools[stack:get_name()].description - for i = 1,enchants_available do - local new_enchant = enchantment_list[math.random(1,table.getn(enchantment_list))] - local level = math.random(1,max_enchant_level) - if meta:get_int(new_enchant) == 0 then - player_level = player_level - 5 - meta:set_int(new_enchant, level) - description = description.."\n"..new_enchant:gsub("^%l", string.upper)..": "..tostring(level) - if new_enchant == "swiftness" then - for index,table in pairs(groupcaps) do - for index2,time in pairs(table.times) do - tool_caps["groupcaps"][index]["times"][index2] = time/(level+1) - end - end - end - if new_enchant == "durable" then - for index,table in pairs(groupcaps) do - tool_caps["groupcaps"][index]["uses"] = table.uses*(level+1) - end - end - - if new_enchant == "sharpness" then - for index,data in pairs(tool_caps.damage_groups) do - tool_caps.damage_groups[index] = data*(level+1) - end - end - end - end - - meta:set_string("description", S("Enchanted @1", description)) - meta:set_string("enchanted", "true") - meta:set_tool_capabilities(tool_caps) - - mcl_experience.set_player_xp_level(clicker,player_level) - - - --create truly random hex - local colorstring = "#" - for i = 1,6 do - colorstring = colorstring..hexer[math.random(1,16)] - end - stack = minetest.itemstring_with_color(stack, colorstring) - clicker:set_wielded_item(stack) - end,clicker) - end -}) - -minetest.register_craft({ - output = "mcl_tools:enchantingtable", - recipe = { - {"mcl_core:obsidian", "mcl_core:obsidian", "mcl_core:obsidian"}, - {"mcl_core:obsidian", "mcl_core:diamond", "mcl_core:obsidian"}, - {"mcl_core:obsidian", "mcl_core:obsidian", "mcl_core:obsidian"}, - }, -}) diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index f0cea989a8..f88ea8fa18 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -592,4 +592,3 @@ minetest.register_tool("mcl_tools:shears", { dofile(minetest.get_modpath("mcl_tools").."/crafting.lua") dofile(minetest.get_modpath("mcl_tools").."/aliases.lua") -dofile(minetest.get_modpath("mcl_tools").."/enchanting.lua") diff --git a/mods/ITEMS/mcl_tools/locale/mcl_tools.de.tr b/mods/ITEMS/mcl_tools/locale/mcl_tools.de.tr index 96bf565f72..6c061dd00f 100644 --- a/mods/ITEMS/mcl_tools/locale/mcl_tools.de.tr +++ b/mods/ITEMS/mcl_tools/locale/mcl_tools.de.tr @@ -30,5 +30,3 @@ Iron Sword=Eisenschwert Golden Sword=Goldschwert Diamond Sword=Diamantschwert Shears=Schere -Enchanted @1= -Enchanting Table= diff --git a/mods/ITEMS/mcl_tools/locale/mcl_tools.es.tr b/mods/ITEMS/mcl_tools/locale/mcl_tools.es.tr index da16cbd29d..40b1d709bc 100644 --- a/mods/ITEMS/mcl_tools/locale/mcl_tools.es.tr +++ b/mods/ITEMS/mcl_tools/locale/mcl_tools.es.tr @@ -30,5 +30,3 @@ Iron Sword=Espada de hierro Golden Sword=Espada de oro Diamond Sword=Espada de diamante Shears=Tijeras -Enchanted @1= -Enchanting Table= diff --git a/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr b/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr index f5fb7a9482..02cd7f2bd6 100644 --- a/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr +++ b/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr @@ -30,5 +30,3 @@ Iron Sword=Épée en Fer Golden Sword=Épée en Or Diamond Sword=Épée en Diamant Shears=Cisailles -Enchanted @1= -Enchanting Table= diff --git a/mods/ITEMS/mcl_tools/locale/mcl_tools.ru.tr b/mods/ITEMS/mcl_tools/locale/mcl_tools.ru.tr index 4eb721d6c2..e82fa15ef0 100644 --- a/mods/ITEMS/mcl_tools/locale/mcl_tools.ru.tr +++ b/mods/ITEMS/mcl_tools/locale/mcl_tools.ru.tr @@ -30,5 +30,3 @@ Iron Sword=Железный меч Golden Sword=Золотой меч Diamond Sword=Алмазный меч Shears=Ножницы -Enchanted @1=@1 зачарованный(ая) -Enchanting Table=Волшебный стол diff --git a/mods/ITEMS/mcl_tools/locale/template.txt b/mods/ITEMS/mcl_tools/locale/template.txt index e083813243..ecb94105f3 100644 --- a/mods/ITEMS/mcl_tools/locale/template.txt +++ b/mods/ITEMS/mcl_tools/locale/template.txt @@ -30,5 +30,3 @@ Iron Sword= Golden Sword= Diamond Sword= Shears= -Enchanted @1= -Enchanting Table= From fe1c8ca7581bc094b402815bff10dd0367b58429 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 23:16:46 +0200 Subject: [PATCH 10/18] Hard-cap XP at 2^31-1 --- mods/HUD/mcl_experience/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index f0560ab7b5..c70bcee127 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -2,6 +2,7 @@ local S = minetest.get_translator("mcl_experience") mcl_experience = {} local pool = {} local registered_nodes +local max_xp = 2^31-1 local gravity = {x = 0, y = -((tonumber(minetest.settings:get("movement_gravity"))) or 9.81), z = 0} local size_min, size_max = 20, 59 -- percents @@ -235,7 +236,7 @@ function mcl_experience.add_experience(player, experience) local temp_pool = pool[name] local old_bar, old_xp, old_level = temp_pool.bar, temp_pool.xp, temp_pool.level - temp_pool.xp = math.max(temp_pool.xp + experience, 0) + temp_pool.xp = math.min(math.max(temp_pool.xp + experience, 0), max_xp) temp_pool.level = mcl_experience.xp_to_level(temp_pool.xp) temp_pool.bar, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) if old_level ~= temp_pool.level then From 3236dc0d8e573e1129075521faf8de9c17b04032 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 23:30:40 +0200 Subject: [PATCH 11/18] Simplify XP bar --- mods/HUD/mcl_experience/init.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index c70bcee127..b984b6d193 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -69,7 +69,9 @@ hud_manager.add_hud = function(player,hud_name,def) hud_elem_type = def.hud_elem_type, position = def.position, text = def.text, + text2 = def.text2, number = def.number, + item = def.item, direction = def.direction, size = def.size, offset = def.offset, @@ -163,20 +165,14 @@ minetest.register_on_joinplayer(function(player) name = player:get_player_name() temp_pool = pool[name] - hud_manager.add_hud(player, "experience_bar_background", - { - hud_elem_type = "statbar", position = {x=0.5, y=1}, - name = "experience bar background", text = "experience_bar_background.png", - number = 36, direction = 0, - offset = {x = (-8 * 28) - 29, y = -(48 + 24 + 16)}, - size = { x=28, y=28 }, z_index = 10, - }) - hud_manager.add_hud(player,"experience_bar", { hud_elem_type = "statbar", position = {x=0.5, y=1}, - name = "experience bar", text = "experience_bar.png", - number = temp_pool.bar, direction = 0, + name = "experience bar", + text = "experience_bar.png", + text2 = "experience_bar_background.png", + number = temp_pool.bar, item = 36, + direction = 0, offset = {x = (-8 * 28) - 29, y = -(48 + 24 + 16)}, size = { x=28, y=28 }, z_index = 11, }) From 5374376e246eed1b6318fd06c9cf40c3c48e5774 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 23:35:46 +0200 Subject: [PATCH 12/18] Don't play XP sound for negative or 0 XP --- mods/HUD/mcl_experience/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index b984b6d193..881667578a 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -237,13 +237,17 @@ function mcl_experience.add_experience(player, experience) temp_pool.bar, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) if old_level ~= temp_pool.level then if minetest.get_us_time()/1000000 - temp_pool.last_time > 0.04 then - minetest.sound_play("level_up",{gain=0.2,to_player = name}) + if experience > 0 then + minetest.sound_play("level_up",{gain=0.2,to_player = name}) + end temp_pool.last_time = minetest.get_us_time()/1000000 end hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) elseif minetest.get_us_time()/1000000 - temp_pool.last_time > 0.01 then temp_pool.last_time = minetest.get_us_time()/1000000 - minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) + if experience > 0 then + minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) + end end if old_bar ~= temp_pool.bar then From 529e3be802847c57173a92fb3790a02966cd0d22 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 23 Oct 2020 23:54:27 +0200 Subject: [PATCH 13/18] Credit kay27 for XP --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fda747a2a1..83bd4d8612 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ There are so many people to list (sorry). Check out the respective mod directori * [ryvnf](https://github.com/ryvnf): Explosion mechanics * MysticTempest: Bugfixes * [bzoss](https://github.com/bzoss): Status effects, potions, brewing stand -* kay27 : Bugfixes, optimizations +* kay27 : Experience system, bugfixes, optimizations * 2mac: Fix bug with powered rail * Lots of other people: TO BE WRITTEN (see mod directories for details) From 730e5f6998f445bcc59c61582242c875a975890d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 24 Oct 2020 11:42:24 +0200 Subject: [PATCH 14/18] Some mcl_experience cleanup --- mods/HUD/mcl_experience/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index 46b55df4ad..ddcdd1562e 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -46,7 +46,7 @@ end -- saves data to be utilized on next login local save_data = function(player) - name = player:get_player_name() + local name = player:get_player_name() local temp_pool = pool[name] local meta = player:get_meta() meta:set_int("xp", temp_pool.xp) @@ -508,7 +508,6 @@ minetest.register_chatcommand("xp", { end mcl_experience.add_experience(player, xp) local playername = player:get_player_name() --- minetest.chat_send_player(name, "Added " .. tostring(xp) .. " XP to " .. playername .. ", they've got " .. tostring(pool[playername].xp) .. " XP, level " .. tostring(pool[playername].level)) minetest.chat_send_player(name, S("Added @1 XP to @2, total: @3, experience level: @4", tostring(xp), playername, tostring(pool[playername].xp), tostring(pool[playername].level))) end, }) From c4f038ab77309c5f757b35ecbfb1c28b69778949 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 24 Oct 2020 13:48:39 +0400 Subject: [PATCH 15/18] Final (hopefully) megre of XP to master, sorry for all possible conflicts --- mods/HUD/mcl_experience/init.lua | 13 ++++++++----- mods/HUD/mcl_experience/locale/mcl_experience.ru.tr | 4 ++-- mods/HUD/mcl_experience/locale/template.txt | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index ddcdd1562e..51346226b4 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -181,7 +181,6 @@ minetest.register_on_joinplayer(function(player) offset = {x = 0, y = -(48 + 24 + 24)}, z_index = 12, }) - end) function mcl_experience.xp_to_level(xp) @@ -237,13 +236,15 @@ function mcl_experience.add_experience(player, experience) local temp_pool = pool[name] local old_bar, old_xp, old_level = temp_pool.bar, temp_pool.xp, temp_pool.level - temp_pool.xp = math.max(temp_pool.xp + experience, 0) + temp_pool.xp = math.min(math.max(temp_pool.xp + experience, 0), max_xp) if (temp_pool.xp >= temp_pool.xp_next_level) or (experience < 1) then temp_pool.level = mcl_experience.xp_to_level(temp_pool.xp) temp_pool.bar, temp_pool.bar_step, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) if old_level ~= temp_pool.level then if minetest.get_us_time()/1000000 - temp_pool.last_time > 0.04 then - minetest.sound_play("level_up",{gain=0.2,to_player = name}) + if experience > 0 then + minetest.sound_play("level_up",{gain=0.2,to_player = name}) + end temp_pool.last_time = minetest.get_us_time()/1000000 end hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) @@ -251,7 +252,9 @@ function mcl_experience.add_experience(player, experience) else if minetest.get_us_time()/1000000 - temp_pool.last_time > 0.01 then temp_pool.last_time = minetest.get_us_time()/1000000 - minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) + if experience > 0 then + minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) + end end temp_pool.bar = temp_pool.bar + temp_pool.bar_step * experience end @@ -478,7 +481,7 @@ minetest.register_entity("mcl_experience:orb", { }) minetest.register_chatcommand("xp", { - params = S("[] []"), + params = S("[[] ]"), description = S("Gives a player some XP"), privs = {server=true}, func = function(name, params) diff --git a/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr b/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr index f4c0b714e2..42cc9ec439 100644 --- a/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr +++ b/mods/HUD/mcl_experience/locale/mcl_experience.ru.tr @@ -1,5 +1,5 @@ -[] []=[<игрок>] [] -Gives a player some XP= +[[] ]=[[<игрок>] ] +Gives a player some XP=Даёт игроку XP Error: Too many parameters!=Ошибка: слишком много параметров! Error: Incorrect value of XP=Ошибка: Недопустимое значение XP Error: Player not found=Ошибка: Игрок не найден diff --git a/mods/HUD/mcl_experience/locale/template.txt b/mods/HUD/mcl_experience/locale/template.txt index 02afd09272..19eb6cc608 100644 --- a/mods/HUD/mcl_experience/locale/template.txt +++ b/mods/HUD/mcl_experience/locale/template.txt @@ -1,4 +1,4 @@ -[] []= +[[] ]= Gives a player some XP= Error: Too many parameters!= Error: Incorrect value of XP= From 196569682930128a16821abdb621ac6c75895f69 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 24 Oct 2020 21:49:11 +0400 Subject: [PATCH 16/18] Merge kay27_textures branch: more recongizable obsidian texture; better NP texture; Nether particles --- mods/CORE/mcl_worlds/init.lua | 6 ++ mods/ENVIRONMENT/mcl_weather/init.lua | 1 + mods/ENVIRONMENT/mcl_weather/nether_dust.lua | 39 +++++++ .../textures/mcl_particles_nether_dust1.png | Bin 0 -> 99 bytes .../textures/mcl_particles_nether_dust2.png | Bin 0 -> 99 bytes .../textures/mcl_particles_nether_dust3.png | Bin 0 -> 101 bytes .../mcl_core/textures/default_obsidian.png | Bin 188 -> 324 bytes .../textures/mcl_portals_portal.png | Bin 1086 -> 561 bytes tools/create_texture__mcl_portals_portal.py | 96 ++++++++++++++---- tools/create_texture__nether_dust.py | 25 +++++ 10 files changed, 147 insertions(+), 20 deletions(-) create mode 100644 mods/ENVIRONMENT/mcl_weather/nether_dust.lua create mode 100644 mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust1.png create mode 100644 mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust2.png create mode 100644 mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust3.png create mode 100644 tools/create_texture__nether_dust.py diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index d032426db6..35549ffad7 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -70,6 +70,12 @@ function mcl_worlds.has_weather(pos) return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64 end +-- Takes a position and returns true if this position can have Nether dust +function mcl_worlds.has_dust(pos) + -- Weather in the Overworld and the high part of the void below + return pos.y <= mcl_vars.mg_nether_max + 64 and pos.y >= mcl_vars.mg_nether_min - 64 +end + -- Takes a position (pos) and returns true if compasses are working here function mcl_worlds.compass_works(pos) -- It doesn't work in Nether and the End, but it works in the Overworld and in the high part of the void below diff --git a/mods/ENVIRONMENT/mcl_weather/init.lua b/mods/ENVIRONMENT/mcl_weather/init.lua index e31331f5e6..c7b8fb6deb 100644 --- a/mods/ENVIRONMENT/mcl_weather/init.lua +++ b/mods/ENVIRONMENT/mcl_weather/init.lua @@ -10,6 +10,7 @@ end dofile(modpath.."/weather_core.lua") dofile(modpath.."/snow.lua") dofile(modpath.."/rain.lua") +dofile(modpath.."/nether_dust.lua") if minetest.get_modpath("lightning") ~= nil then dofile(modpath.."/thunder.lua") diff --git a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua new file mode 100644 index 0000000000..2fc7e5dd41 --- /dev/null +++ b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua @@ -0,0 +1,39 @@ +mcl_weather.nether_dust = {} +mcl_weather.nether_dust.particles_count = 99 + +-- calculates coordinates and draw particles for Nether dust +mcl_weather.nether_dust.add_dust_particles = function(player) + for i=mcl_weather.nether_dust.particles_count, 1,-1 do + local rpx, rpy, rpz = mcl_weather.get_random_pos_by_player_look_dir(player) + minetest.add_particle({ + pos = {x = rpx, y = rpy - math.random(6, 18), z = rpz}, + velocity = {x = math.random(-30,30)*0.01, y = math.random(-15,15)*0.01, z = math.random(-30,30)*0.01}, + acceleration = {x = math.random(-50,50)*0.02, y = math.random(-20,20)*0.02, z = math.random(-50,50)*0.02}, + expirationtime = 3, + size = math.random(6,20)*0.01, + collisiondetection = false, + object_collision = false, + vertical = false, + glow = math.random(0,minetest.LIGHT_MAX), + texture = "mcl_particles_nether_dust"..tostring(i%3+1)..".png", + playername = player:get_player_name() + }) + end +end + +local timer = 0 +minetest.register_globalstep(function(dtime) + timer = timer + dtime + if timer >= 0.7 then + timer = 0 + else + return + end + + for _, player in ipairs(minetest.get_connected_players()) do + if (mcl_weather.is_underwater(player) or not mcl_worlds.has_dust(player:get_pos())) then + return false + end + mcl_weather.nether_dust.add_dust_particles(player) + end +end) diff --git a/mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust1.png b/mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust1.png new file mode 100644 index 0000000000000000000000000000000000000000..25c71fba3be78495330f1a24b12ce04b2b9ed1bf GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)gaYymzYu0Xm!GcEqX$B#f3Q%R6t qFvEN?W#_j*9+#(!V@SoE?&t;ucLK6VwR~MTA literal 0 HcmV?d00001 diff --git a/mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust2.png b/mods/ENVIRONMENT/mcl_weather/textures/mcl_particles_nether_dust2.png new file mode 100644 index 0000000000000000000000000000000000000000..73135f3bb6fbb7b6ad2111e3eb9667f6dfab054e GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-Y$P6UUy?J{QNU;U@gt!9f{>-%a2OmEISxhBC re!&d$#gv`j0(o4XE{-7;bCNB9>_ZF(gW|#ifh-13S3j3^P6TY2?c(s&I7%0x*>FVdQ&MBb@08s-OGXMYp literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_core/textures/default_obsidian.png b/mods/ITEMS/mcl_core/textures/default_obsidian.png index 32b3371cef4b884e38755fc5c755bd368f282e01..a7f1d8896e2ec390565519fb55b66b5f2eb10bad 100644 GIT binary patch delta 309 zcmV-50m}Zo0mK537=H)?0001xk!Usm000SaNLh0L01m?d01m?e$8V@)0002?NklZ$=M!UKU|?gAVqjqS#qf*)FOcA|XXaq%P7COK^yJ<5U+=zrd-dn{A2h_xD$mTo z3z7Q#<1sS_JNMHkzwf`=@$>h4Oe5EK-Z^yk?K=Z;;NSnh zOlU%iVjlcl%9u*|xs)N|=o;?7+VSz*T}%x^JgN`|xlV%HNYI5$5K*{|Xu!|KONd7m zSq~Ef14Cc&6kKkYxGeA8m)pp`!r})-F%L9F$bMkvVCR+tcrI{Z_X7h116FT9ZTR>9FC0NsL&6O%h^z+y69=Cysm7><00000NkvXX Hu0mjf*5H!b delta 172 zcmV;d08{_O0=xl`7=Hu<0002(-QrRJ000kAOjJcsO*}<6G%zVD9~>rTWl>u$z`Ote z0BA`>K~#7F4UN$e0zn8v6UPD;v;YYW$kM=`bN$yOlh5~(fI*qe;b5|kpyi$4pU^vt z60t|HZ9q(3WroGNa?xRG^knwsHbTzQ^8|N9 z55lbMKvNWwk_0>mo;)Y8LMt9t*bS{96p5u?_0X#a59&b_B7f9F{saFAH+?XN_ulvW z`Oaeo=H)zxv&`X%j&7k22;_$s23cJ&jNf$uZE}tD$H`Z!BDX#!HD4)xm&Easy-ex5 zSs%s~32r?1_Yj~wL)oZc#g&-Y}eao<~)$b=48W&vu8YgOFol#c8N`jGKFbagq30obypbp zFQ$)REK4xjZwwIv+h}c0T4;M4ZG>tP&}}4G_z+-h<{GeN>_agx*L6jN z^~J&=PDG4*yAK918VP=`rT?gUb?y6rR8{=>ON1~NH-9OmC#4T9azOQz1rxbMC75x# zQtj|2lw~oHZGNUo1yx0=2v4_&P_c?BC0TyYoO3}fpR*LqkcIRBu nEWZ1`LmoaEP8-A)3b+3QuX}}IFzC$200000NkvXXu0mjfK|c3S delta 1078 zcmV-61j+lc1ilE67k@wq0{{R3B%=qU0002VP)t-sP6n?@1+Pj4uSNy0M+L7$1g}B_ zuSEo}NCmG@2Cqy7uS*55O$M(`1+P&CuSW&1QwOh72Cq{FuTciCR0pp^1g}~MuUQAL zRR^zI2(MfSuVo6aX9}-q3a?)YuV4wUW(u!Y2d`rZuX7Bqbbk%6ZVaz)46k(!uS^B6 zSO>3O2(N1kuV4wUY74Jz3$H%}uTKWARR^y|1g~NVuW<~obq%j<3$JMkuW}5pSqQII z2d`ZSuUQALWD2ij39ohyuWk#ka15_$3$LntEq4F_07G3T+rlzN;r>Cf> zsi&!_si>)@tADGitE;ZBudJ=Es;#rLv9YtLs;scAu&|}5siv*6w6L$UtE#N3uCBDP zvackZr^)~T0^vzSK~#7FEt7|WqA(DKC&4Ts31AR|0ov8MqJ79?d?> z4x4|c<|!7~5UwGq&X?K95^#NOUf=Avw8q+4a;(;~*?YeIDDwPOQ-Z|2O>zEg zzAoMSTO_f82QR1kd$+q@a;p^whkCE`?xz)pW`8?YWCTi=Y0(@w+kJhMEjEP2OHSY2 z?U%bQ%FwdVz1iSOf4 zx!_3QBMPbsrvlb45R3uha8%F3aX1jy<<7u^AR1g_tpKPbL?M>8UjvQ^V$v#v62JIv zzkjVU#+GCI_GL13&BAm1I|O`AQZ+J1xZm8#((;MBZm@&zDNN+VgeIXzn2ec8tc}DF+$<}e9_M+Hj=>$GT`!vDVpa6fzK4H#N_Y404|?4G{jCN)?gCvm z(RL7MP^`Ng{?vEHdI?YGb9SifK|3Ot0j%mo@KV}qH1ZnJC2LJ#707*qoM6N<$f-|7=wg3PC diff --git a/tools/create_texture__mcl_portals_portal.py b/tools/create_texture__mcl_portals_portal.py index f2b1e1524e..6f0725f699 100644 --- a/tools/create_texture__mcl_portals_portal.py +++ b/tools/create_texture__mcl_portals_portal.py @@ -1,7 +1,44 @@ import png -w, h = 64, 256; +w, h = 16, 128; 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): + if(t == 1): + s[y][x] = 1 + elif t==2: + s[y][x] = 1 - s[y][x] + elif t==3: + s[y][x] = s[y][x] + 1 + if s[y][x] > 3: + s[y][x] =s[y][x]-4 + +def circle(X1, Y1, R, t): + x = 0 + y = R + delta = 1 - 2 * R + error = 0 + while y >= 0: + if Y1%w + y < w: + drawpixel(X1 + x, Y1 + y, t) + if Y1%w - y >= 0: + drawpixel(X1 + x, Y1 - y, t) + if Y1%w + y < w: + drawpixel(X1 - x, Y1 + y, t) + if Y1%w - y >= 0: + drawpixel(X1 - x, Y1 - y, t) + error = 2 * (delta + y) - 1 + if ((delta < 0) and (error <= 0)): + x = x + 1 + delta = delta + 2 * x + 1 + elif ((delta > 0) and (error > 0)): + y = y - 1 + delta = delta - 2 * y + 1 + else: + x = x + 1 + y = y - 1 + delta = delta + 2 * (x - y) + def line(y1, x1, y2, x2, v): signx = 1 signy = 1 @@ -19,10 +56,14 @@ def line(y1, x1, y2, x2, v): if dx >= dy: dir1 = 1 for i in range(max(dx, dy)+1): - if v==2: - s[x1][y1]=1-s[x1][y1] - else: - s[x1][y1] = v + if(v == 1): + s[x1][y1] = 1 + elif v==2: + s[x1][y1] = 1 - s[x1][y1] + elif v==3 or (v==4 and ((x1^y1)&1)) or (v==5 and (((x1|y1)&1)==0)) or (v==7 and ((((x1+1)|y1)&1)==0)) or (v==8 and ((((x1+1)|(y1+1))&1)==0)) or (v==6 and (((x1|(y1+1))&1)==0)): + s[x1][y1] = s[x1][y1] + 1 + if s[x1][y1] > 3: + s[x1][y1] = s[x1][y1] - 4 if dir1 == 1: x1 += signx offsy += dy @@ -37,22 +78,37 @@ def line(y1, x1, y2, x2, v): offsx -= dy # R, G, B, Alpha (0xFF = opaque): -palette=[(0x00,0x00,0xaf,0xa0), (0x7f,0x0f,0xaf,0xb8)] +palette=[ + (0x30,0x03,0xaf,0xa4), + (0x4f,0x1c,0xaf,0xb4), + (0x7f,0x3d,0xa0,0xc8), + (0x6d,0x5d,0x99,0xb1) +] -for j in range(16): - i = j * 4 - line(i, 0, 63-i, 63, 2) - line(63, i, 0, 63-i, 2) - i+=1 - line(i, 64, 63-i, 127, 2) - line(63, 64+i, 0, 127-i, 2) - i+=1 - line(i, 128, 63-i, 191, 2) - line(63, 128+i, 0, 191-i, 2) - i+=1 - line(i, 192, 63-i, 255, 2) - line(63, 192+i, 0, 255-i, 2) +circles = h//w +maxr = w//2 +for i in [1,2,3,5,9,10,11,13]: + for c in range(circles): + q = ((circles-c-1)+i)%w + circle(maxr, maxr+c*w, q, 3) -w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1) + +linesperside = 2 +linestarts = round(w / linesperside) # 8 +lineoffset = round(w / linestarts) # 2 +wminus = w - 1 + +for j in range(linesperside): + for k in range(linestarts): + offset = k * w + for q in [0,1,3,4]: +# for q in [1]: + i = j*linestarts + ((k+q)%linestarts) + line(i, offset, wminus-i, offset+wminus, 5+(k&3)) + line(wminus, offset+i, 0, offset+wminus-i, 5+(k&3)) + + + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=2) f = open('mcl_portals_portal.png', 'wb') w.write(f, s) diff --git a/tools/create_texture__nether_dust.py b/tools/create_texture__nether_dust.py new file mode 100644 index 0000000000..f1b8e27f24 --- /dev/null +++ b/tools/create_texture__nether_dust.py @@ -0,0 +1,25 @@ +import png + +s = [ + [ + '1', + ], + [ + '11', + ], + [ + '111', + '111', + ], +] + +# R, G, B, Alpha (0xFF = opaque): +palette=[(0x00,0x00,0x00,0x00), (0x8F,0x69,0x66,0x9F)] +#palette=[(0x00,0x00,0x00,0x00), (0xF0,0xF0,0xF0,0x80)] + +for i in range(0, len(s)): + print(str(i)+"/"+str(len(s))) + q = [[int(c) for c in row] for row in s[i]] + w = png.Writer(len(q[0]), len(q), palette=palette, bitdepth=1) + f = open('mcl_particles_nether_dust'+str(i+1)+'.png', 'wb') + w.write(f, q) From 9f981173286d69269526597a58c0d9115066a558 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 26 Oct 2020 01:06:35 +0400 Subject: [PATCH 17/18] Fix XP and Nether ashes --- mods/ENVIRONMENT/mcl_weather/nether_dust.lua | 2 +- mods/HUD/mcl_experience/init.lua | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua index 2fc7e5dd41..e41746a715 100644 --- a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua +++ b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua @@ -31,7 +31,7 @@ minetest.register_globalstep(function(dtime) end for _, player in ipairs(minetest.get_connected_players()) do - if (mcl_weather.is_underwater(player) or not mcl_worlds.has_dust(player:get_pos())) then + if not mcl_worlds.has_dust(player:get_pos()) then return false end mcl_weather.nether_dust.add_dust_particles(player) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index 51346226b4..7483538f7f 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -3,6 +3,7 @@ mcl_experience = {} local pool = {} local registered_nodes local max_xp = 2^31-1 +local max_orb_age = 300 -- seconds local gravity = {x = 0, y = -((tonumber(minetest.settings:get("movement_gravity"))) or 9.81), z = 0} local size_min, size_max = 20, 59 -- percents @@ -147,7 +148,7 @@ function mcl_experience.set_player_xp_level(player,level) return end pool[name].level = level - pool[name].xp, pool[name].next_level = mcl_experience.bar_to_xp(pool[name].bar, level) + pool[name].xp, pool[name].bar_step, pool[name].next_level = mcl_experience.bar_to_xp(pool[name].bar, level) hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(level)}) -- we may don't update the bar end @@ -237,7 +238,7 @@ function mcl_experience.add_experience(player, experience) local old_bar, old_xp, old_level = temp_pool.bar, temp_pool.xp, temp_pool.level temp_pool.xp = math.min(math.max(temp_pool.xp + experience, 0), max_xp) - if (temp_pool.xp >= temp_pool.xp_next_level) or (experience < 1) then + if (temp_pool.xp >= temp_pool.xp_next_level) or (temp_pool.xp < old_xp) then temp_pool.level = mcl_experience.xp_to_level(temp_pool.xp) temp_pool.bar, temp_pool.bar_step, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) if old_level ~= temp_pool.level then @@ -342,7 +343,7 @@ local function xp_step(self, dtime) self.age = self.age + dtime - if self.age > 300 then + if self.age > max_orb_age then self.object:remove() return end From 38ad237d92d4c650542a68ff05024c452a017100 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 26 Oct 2020 10:24:38 +0400 Subject: [PATCH 18/18] Fix multithreaded addition of XP --- mods/HUD/mcl_experience/init.lua | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index 7483538f7f..7ffa20bdf5 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -238,31 +238,31 @@ function mcl_experience.add_experience(player, experience) local old_bar, old_xp, old_level = temp_pool.bar, temp_pool.xp, temp_pool.level temp_pool.xp = math.min(math.max(temp_pool.xp + experience, 0), max_xp) - if (temp_pool.xp >= temp_pool.xp_next_level) or (temp_pool.xp < old_xp) then + + if (temp_pool.xp < temp_pool.xp_next_level) and (temp_pool.xp >= old_xp) then + temp_pool.bar = temp_pool.bar + temp_pool.bar_step * experience + else temp_pool.level = mcl_experience.xp_to_level(temp_pool.xp) temp_pool.bar, temp_pool.bar_step, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) - if old_level ~= temp_pool.level then - if minetest.get_us_time()/1000000 - temp_pool.last_time > 0.04 then - if experience > 0 then - minetest.sound_play("level_up",{gain=0.2,to_player = name}) - end - temp_pool.last_time = minetest.get_us_time()/1000000 - end - hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) - end - else - if minetest.get_us_time()/1000000 - temp_pool.last_time > 0.01 then - temp_pool.last_time = minetest.get_us_time()/1000000 - if experience > 0 then - minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) - end - end - temp_pool.bar = temp_pool.bar + temp_pool.bar_step * experience end if old_bar ~= temp_pool.bar then hud_manager.change_hud({player = player, hud_name = "experience_bar", element = "number", data = math.floor(temp_pool.bar)}) end + + if experience > 0 and minetest.get_us_time()/1000000 - temp_pool.last_time > 0.01 then + if old_level ~= temp_pool.level then + minetest.sound_play("level_up",{gain=0.2,to_player = name}) + temp_pool.last_time = minetest.get_us_time()/1000000 + 0.2 + else + minetest.sound_play("experience",{gain=0.1,to_player = name,pitch=math.random(75,99)/100}) + temp_pool.last_time = minetest.get_us_time()/1000000 + end + end + + if old_level ~= temp_pool.level then + hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) + end end --reset player level