Files
neoStudiosLCE-neoLegacy/Minecraft.Client/WaterWakeParticle.cpp
Logan Gibson d8da9af7fe Add particles when fishing (#1)
Co-authored-by: Lord_Cambion <lordcambion.gaming@gmail.com>
2026-04-12 14:18:03 +03:00

47 lines
1.2 KiB
C++

#include "stdafx.h"
#include "WaterWakeParticle.h"
#include "../Minecraft.World/Random.h"
#include "../Minecraft.World/Mth.h"
#include "../Minecraft.World/JavaMath.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "../Minecraft.World/net.minecraft.world.level.material.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
WaterWakeParticle::WaterWakeParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, 0, 0, 0)
{
xd *= 0.30000001192092896;
yd = random->nextDouble() * 0.2 + 0.1;
zd *= 0.30000001192092896;
rCol = 1.0f;
gCol = 1.0f;
bCol = 1.0f;
setMiscTex(19);
setSize(0.01f, 0.01f);
lifetime = (int)(8.0 / (random->nextDouble() * 0.8 + 0.2));
gravity = 0.0F;
xd = xa;
yd = ya;
zd = za;
}
void WaterWakeParticle::tick()
{
xo = x;
yo = y;
zo = z;
move(xd, yd, zd);
xd *= 0.9800000190734863;
yd *= 0.9800000190734863;
zd *= 0.9800000190734863;
int i = 60 - lifetime;
float f = (float)i * 0.001f;
this->setSize(f, f);
this->setMiscTex(19 + i % 4);
if (lifetime-- <= 0)
{
this->remove();
}
}