the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 62 lines 1.0 kB view raw
1#include "stdafx.h" 2#include "..\Minecraft.World\JavaMath.h" 3#include "SpellParticle.h" 4 5SpellParticle::SpellParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, xa, ya, za) 6{ 7 yd *= 0.2f; 8 if (xa == 0 && za == 0) 9 { 10 xd *= 0.1f; 11 zd *= 0.1f; 12 } 13 14 size *= 0.75f; 15 16 lifetime = (int) (8 / (Math::random() * 0.8 + 0.2)); 17 noPhysics = false; 18 19 baseTex = 8 * 16; 20} 21 22void SpellParticle::render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2) 23{ 24 float l = ((age + a) / lifetime) * 32; 25 if (l < 0) l = 0; 26 if (l > 1) l = 1; 27 28 Particle::render(t, a, xa, ya, za, xa2, za2); 29} 30 31void SpellParticle::tick() 32{ 33 xo = x; 34 yo = y; 35 zo = z; 36 37 if (age++ >= lifetime) remove(); 38 39 setMiscTex(baseTex + (7 - age * 8 / lifetime)); 40 41 yd += 0.004; 42 move(xd, yd, zd); 43 if (y == yo) 44 { 45 xd *= 1.1; 46 zd *= 1.1; 47 } 48 xd *= 0.96f; 49 yd *= 0.96f; 50 zd *= 0.96f; 51 52 if (onGround) 53 { 54 xd *= 0.7f; 55 zd *= 0.7f; 56 } 57} 58 59void SpellParticle::setBaseTex(int baseTex) 60{ 61 this->baseTex = baseTex; 62}