the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 42 lines 1.2 kB view raw
1#include "stdafx.h" 2#include "SuspendedParticle.h" 3#include "..\Minecraft.World\Random.h" 4#include "..\Minecraft.World\net.minecraft.world.level.h" 5#include "..\Minecraft.World\JavaMath.h" 6#include "..\Minecraft.World\Mth.h" 7#include "..\Minecraft.World\net.minecraft.world.level.material.h" 8 9SuspendedParticle::SuspendedParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level,x, y - 2 / 16.0f, z, xa, ya, za) 10{ 11 // 4J-JEV: Set particle colour from colour-table. 12 unsigned int col = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Particle_Suspend ); 13 rCol = ( (col>>16)&0xFF )/255.0f, gCol = ( (col>>8)&0xFF )/255.0, bCol = ( col&0xFF )/255.0; 14 15 //rCol = 0.4f; 16 //gCol = 0.4f; 17 //bCol = 0.7f; 18 19 setMiscTex(0); 20 this->setSize(0.01f, 0.01f); 21 22 size = size * (random->nextFloat() * 0.6f + 0.2f); 23 24 xd = xa * 0.0f; 25 yd = ya * 0.0f; 26 zd = za * 0.0f; 27 28 lifetime = (int) (16 / (Math::random() * 0.8 + 0.2)); 29} 30 31void SuspendedParticle::tick() 32{ 33 xo = x; 34 yo = y; 35 zo = z; 36 37 move(xd, yd, zd); 38 39 if (level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z)) != Material::water) remove(); 40 41 if (lifetime-- <= 0) remove(); 42}