the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "BubbleParticle.h"
3#include "..\Minecraft.World\Random.h"
4#include "..\Minecraft.World\Mth.h"
5#include "..\Minecraft.World\JavaMath.h"
6#include "..\Minecraft.World\net.minecraft.world.level.h"
7#include "..\Minecraft.World\net.minecraft.world.level.material.h"
8
9BubbleParticle::BubbleParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, xa, ya, za)
10 {
11 rCol = 1.0f;
12 gCol = 1.0f;
13 bCol = 1.0f;
14 setMiscTex(32);
15 this->setSize(0.02f, 0.02f);
16
17 size = size*(random->nextFloat()*0.6f+0.2f);
18
19 xd = xa*0.2f+(float)(Math::random()*2-1)*0.02f;
20 yd = ya*0.2f+(float)(Math::random()*2-1)*0.02f;
21 zd = za*0.2f+(float)(Math::random()*2-1)*0.02f;
22
23 lifetime = (int) (8 / (Math::random() * 0.8 + 0.2));
24}
25
26void BubbleParticle::tick()
27{
28 xo = x;
29 yo = y;
30 zo = z;
31
32 yd += 0.002;
33 move(xd, yd, zd);
34 xd *= 0.85f;
35 yd *= 0.85f;
36 zd *= 0.85f;
37
38 if (level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z)) != Material::water) remove();
39
40 if (lifetime-- <= 0) remove();
41}