From 511ddd8263a255c316194b0741df29ba927dcf8f Mon Sep 17 00:00:00 2001 From: MeseCraft Date: Mon, 18 Jul 2022 23:36:34 -0500 Subject: [PATCH] update void_chest: particle optimizations, particle switch, animated. --- README.md | 6 +++--- init.lua | 16 ++++++++++++---- mod.conf | 4 ++-- settingtypes.txt | 1 + textures/void_chest_void_particle.png | Bin 1632 -> 4253 bytes 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8dd7b64..ecd72b2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -saras_simple_survival mod: void_chest +mesecraft mod: void_chest ===================================== -Copyright 2020 freegamers.org +Copyright 2022 mesecraft.com Description @@ -45,4 +45,4 @@ This mod is a fork of morechests, which itself is a fork of 0gb.us's mod called https://forum.minetest.net/viewtopic.php?f=11&t=4366 The textures used for void chests are from jp's "xdecor" mod, which in turn are from the PixelBOX Reloaded texture pack for Minetest. -https://github.com/minetest-mods/xdecor \ No newline at end of file +https://github.com/minetest-mods/xdecor diff --git a/init.lua b/init.lua index 69c021f..1830ff9 100644 --- a/init.lua +++ b/init.lua @@ -46,11 +46,12 @@ minetest.register_node("void_chest:void_chest", { on_timer = function(pos) if void_chest.show_particles then -- Particles for the void effect, implemented by MisterE, thanks! - for i=1,10 do -- number of particles spawned every on_timer + for i=1,2 do -- number of particles spawned every on_timer + local spin_speed = math.random(80,175)/1000 --controls how fast a particular particle spins local vel_scalar = math.random(0,5)/10 -- multiplied by the particle's velocity vector of 1 local accel_scalar = math.random(1,5)/10 -- multiplied by the particle's accel vector of 1 - local expir = math.random(1,10) -- number of sec particle will last, if it doesn't hit a node - local particle_pos = {x=pos.x + ((math.random(-10,10)/10)*(math.random(6,15)/10)), y=pos.y + ((math.random(-10,10)/10)*(math.random(6,15)/10)), z=pos.z+ ((math.random(-10,10)/10)*(math.random(6,15)/10))} + local expir = math.random(1,5) -- number of sec particle will last, if it doesn't hit a node + local particle_pos = {x=pos.x + ((math.random(-15,15)/10)*(math.random(6,15)/10)), y=pos.y + ((math.random(-15,15)/10)*(math.random(6,15)/10)), z=pos.z+ ((math.random(-15,15)/10)*(math.random(6,15)/10))} local part_vel = vector.direction(particle_pos, pos) part_vel = {x= vel_scalar*part_vel.x, y= vel_scalar*part_vel.y, z= vel_scalar*part_vel.z} local part_accel = vector.direction(particle_pos, pos) @@ -60,11 +61,17 @@ minetest.register_node("void_chest:void_chest", { velocity = part_vel, acceleration = part_accel, expirationtime = expir, - size = math.random(7,10)/10, + size = math.random(5,15)/10, collisiondetection = true, collision_removal = true, vertical = false, texture = "void_chest_void_particle.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = spin_speed, + }, glow = 5, }) end @@ -100,3 +107,4 @@ minetest.register_on_joinplayer(function(player) local inv = player:get_inventory() inv:set_size("void_chest:void_chest", 8*4) end) + diff --git a/mod.conf b/mod.conf index 3ea3733..67ce20c 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,5 @@ name = void_chest description = Access your belongings anywhere by using the power of the void chest! -author = FreeGamers.org +author = MeseCraft depends = default -optional_depends = magic_materials \ No newline at end of file +optional_depends = magic_materials diff --git a/settingtypes.txt b/settingtypes.txt index cd61ae1..1e9a17c 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -2,6 +2,7 @@ # VOID CHEST: # on low performance servers the particles can cause a drop in performance. + # Default: true void_chest.show_particles (Show Particles) bool true diff --git a/textures/void_chest_void_particle.png b/textures/void_chest_void_particle.png index 409688a97a1a3080e5ed737c5c7082d087475a99..423ba377b2946535c304f83cf814e54dc399107f 100644 GIT binary patch delta 4235 zcmV;65OnY044om67k@wq1^@s66MgrV000e0dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)I zW&i+q+O3#raw|EKg#Y6dbA-eaSdN3$Y;G{epU*)`qN?ka_1Ls%qNrpN2!wlhc+ly5yr$lv(-x90ct z&Go?j;eCC+*XdlhkA>QPzcGHl(ccS&`rhCxl=nu_zczT@3%mYaD2DgW?-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