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 7c57334be..d23e8ad0b 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 c9da0c498..71627aada 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 ad65eb122..45cc3e621 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 000000000..50d3312a8 --- /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 e3ca8a86b..2adcd7cf8 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 df3ad90f2..3914c2a98 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 3f024383e..08c7de07b 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 zcmdT~ZH!jM6@CDbvI4e6gyo|`VU@11AP7a+y$4pd1wVkWRJVpS)a@qaL&}F}h;4G- zWDyYpXk#b|iIhm%fY1`5CYIe76a$IHrcxW*B{ifCAypELHf_;mo9CXHcbBbq@A=ao zo@6sK%=6C7oq6V*^V~~q?bNwHo&xj&P`mg$^;HP|){k%Vx*)R_+UQ$1xzYWdB^ae2fu}#J1 zN8d^g_8B8DY`m{HxX+tO`=)CNfCSK_*mkMq)BQIT7o7X}_=UonY8}zsS}2@2ZsTjR zxBPI+@8%s#^z`oHsKTI@Ib+W!7l*7bhWTai$wKiDKiMa(AC?slS3F$YuxN|Cy1T8_ z#_y^B1lJ(Nwo5fH4#DgN=RU5!P*`((^!tC6Lg7R;`}nuF{BX^{r+12;-YugFgKF0N z{%N^5WPRGl^=CgH$4{RxV|-2LpZ?e;d9mYJIoM}R@r8}|$y2+wN&BX2tqA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zpucvEYcb5XUW;?ke>nERVxez;EnfQ0&0;Eanu8A(cYQpw*bF`G;IGAR-@ULH@4Ii7 z2l(!>G6%`A*0qb)F-S z3c03^cjRXwAJuV=ypO_(LBf+yQVe}IApLHDE5m2BqO$q5E5m0@?Tjx`3#FE7q3bn} zisi2=mYb?r-l<|arHbW?DwYeXSe~b1Ih=~+XDXI^saRg6VmXtF!?^BqhdLV zisc_FmRqP;-k@SRfr`a@6^rF67N=E04363EXJxBhhmJ0@gv5D==Y;f zkN!IP;^=3i4~_mY`o8GbqR)!{DEgY{N1~62_dnk4cyHsKjQ1_xrFc)`9fN}9 zoQr(=ziXfz{%O?W+n+Z^aNK1&irIo`zwAG)cL=$zL;NvzUV4Q#omIb*c%QNdwZc`Zzfdit%HiaQBbkB z1uFI?K*dzPiYa&%Q|BtCyj4t9tJs$y6?<)~Vy`V#>`Rb}eF;*rFF`8yB}m1-1gY4U zAQk%(q|*IMP!9h}UW`2RVyS|>SgIf|mMX}Lr3&(5se-&%svs|xD#(ka3i4v9g1lI& zATO3G$cv>4@?xoiyjZFrFP19Ei=_(kVyS|>SgIf|mMX}Lr3&(5se-&%svs|xD#(ka z3i4v9g1lI&ATO3G$cv>4@?xoiyjZFrFP19Ei=_(kVyS|>SgIf|mMX}Lr3&(5se-&% zsvs|xD#(ka3i4v9g1lI&ATO3G$cv>4@?xoiyjZFrFP1rw7t1`!i)Ak5#WLUWVwsb9 lvCP}NSmt(KEb~7vmN}vq%RJJHWv=PPG9UF~nX`Ja{{^wjZ2|xQ literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_end/models/mcl_end_crystal.png b/mods/ITEMS/mcl_end/models/mcl_end_crystal.png new file mode 100644 index 0000000000000000000000000000000000000000..13e12c2ea0038b266a324e4c80996ba9234182c7 GIT binary patch literal 1940 zcmY*Wc{m$*8vaGx8YGSqDGAeJl@eEtD>P`wT`a{q>grUf6qSlbqNULaF*7!lV$5`A zcKfKKzp?tt2Iah<(iTF|&Vs-yh%m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!U=g&)TS=hEo`s-wKY3CdD3oY5Qzi(Mso& z1N9@rcI!;3UrT&vsF_Zoa)1$yLsvjJ>C|;{#|@(XIP}vv)3aYBlv-1JS5wE+!VKRlNZM*UqVCSVKjxVEz18@2ZrdlgnFCq<@J$F46lM%zTZFKGnp}AeXC?VvYhN- z@z)*Qr}BGP$gntv2d3~2gTAKHdo5kXN10V$WZPZoq&$(uE6i0bD1yanF8LUNZE#0NiI+*kqRN6zRVPREXJLSjC9+p?GFf*QV1{)v~ zCAZ3?SSn!*bKHf^N!R527sQ*5T6N{^i^bqzSwlyD^k^JI)queaQAJ$;h3|Zi$PZLI zX(PPgQ6=N$%9bX9v@0D$o_`vIJE>Up(@Tj5E{mOf)5x^Ei;p}LceVAC2PDEl42G)6 zlp;U6kWcJHz_9Y@zP*)x?_hXkRrT(FAfou0AgQPL?J?1$*p2l3*bCy|%Pazw3+z-J z1ldn{0^?rtG<(J9LhO%m!P-L;%_0{>X6bHJVU4G36`~#<+6U45;FDh7#grmit2X+^ zM3R+0xe$tjEBL6bMYP_O1ghSy6`7rVIr(sM{e}s+xsa=?kv%wh=h`e{w@ohI3PS-s zzPaIGQ|`Z+;&fSuthd=y212UU=}PR_P6#{N=&3YmN3u0>2N2bZe?^J zG%heMHD!e|WdHyG;z>k7R5(wqlQ9YcK@3IbRAOtXU}GtG3oEzx05;+QEVZ+-5G-sh zy-wtXWJzY$Mh$#+lKlTOGwhVVgou>=<|yF2yU6u)m*?ZAU=64P=b`DtiXx`9cY?1Ox*MIuh7k(w5D zJ!*dckw}J2{BnoHi60*mK;T>U8wb>#lOEIeQOX;8BVj=#c*eZ|0000 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 50d3312a8..9872907f2 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 zcmds8cUTq2*B-<|k)qgp0l{7_nyBmyc15JADE3|=_TFGM>QAE*Tdc96h+T>;0yEZN zEQnx>QDcc>Vk8!fUB2h+&f%{2UVq=;-#5=QnZ22J&%Sf!OnV1gw>Gtn3?;;l5YjrV zd)Ed;K2MlDaYTbgjT#d|RQ7q+5s>op^Yep(+qSC{O32vBlNt;jIbm?*P_4?GtY62} zrCryKSDbV+;bGmn7I)N51DQgEkSNCx5m;wFo8=h7d@g#3NgcOA$p|5o5S1G0g`r;P z_VxPv>+1N=a@6ZHzN_dDIQe}B@5_44zO0w_|6BcWO7wbWc%K>G2OD6Y8Tc~;e{iXh zzeW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VyS|>SgIf|mMX}Lr3&(5se-&%svs|xD#(ka3i4v9g1lI& zATO3G$cv>4@?xoiyjZFrFP19Ei=_(kVyS|>SgIf|mMX}Lr3&(5se-&%svs|xD#(ka z3i4v9g1lI&ATO3G$cv>4@?xoiyjZFrFP19Ei=_(kVyS|>SgIf|mMX}Lr3&(5se-&% zsvs|xD#(ka3i4v9g1lI&ATO3G$cv>4@?xoiyjZFrFP1rw7t1`!i)Ak5#WLUWVwsb9 lvCP}NSmt(KEb~7vmN}vq%RJJHWv=PPG9UF~nX`Ja{{^wjZ2|xQ From 299099116b210900a417d53e188b267c6761736c Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein 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 9872907f2..c07ff7930 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 3914c2a98..69a3408bb 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 7b5762de8..fda747a2a 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 bb62acbec..07f2631a5 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 07f2631a5..f0560ab7b 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 1d2195e8d..72767125b 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 963d9dffa..93c0f1bdb 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 be01c1857..000000000 --- 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 f0cea989a..f88ea8fa1 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 96bf565f7..6c061dd00 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 da16cbd29..40b1d709b 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 f5fb7a948..02cd7f2bd 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 4eb721d6c..e82fa15ef 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 e08381324..ecb94105f 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 f0560ab7b..c70bcee12 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 c70bcee12..b984b6d19 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 b984b6d19..881667578 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 fda747a2a..83bd4d861 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 46b55df4a..ddcdd1562 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 ddcdd1562..51346226b 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 f4c0b714e..42cc9ec43 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 02afd0927..19eb6cc60 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 d032426db..35549ffad 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 e31331f5e..c7b8fb6de 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 000000000..2fc7e5dd4 --- /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!ia0y~yU|dGab;j&=+8`xfAH}m zNV+7*FPLGzn6mR*1_lNmPZ!6KiaE&@2R<+`Ft;!syjsd9%)r3F;OXk;vd$@?2>?+8 B88ZL? 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 z55lbMKvNWw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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 f2b1e1524..6f0725f69 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 000000000..f1b8e27f2 --- /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 2fc7e5dd4..e41746a71 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 51346226b..7483538f7 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 7483538f7..7ffa20bdf 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