mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
github.dev removing files randomly lmfao
This commit is contained in:
41
source/world/particle/BubbleParticle.cpp
Normal file
41
source/world/particle/BubbleParticle.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/********************************************************************
|
||||
Minecraft: Pocket Edition - Decompilation Project
|
||||
Copyright (C) 2023 iProgramInCpp
|
||||
|
||||
The following code is licensed under the BSD 1 clause license.
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#include "Particle.hpp"
|
||||
#include "Level.hpp"
|
||||
|
||||
BubbleParticle::BubbleParticle(Level* level, float x, float y, float z, float vx, float vy, float vz) :
|
||||
Particle(level, x, y, z, vx, vy, vz)
|
||||
{
|
||||
field_F8 = field_FC = field_100 = 1.0f;
|
||||
field_DC = PTI_BUBBLE;
|
||||
setSize(0.02f, 0.02f);
|
||||
|
||||
field_F0 *= 0.2f + 0.6f * sharedRandom.nextFloat();
|
||||
m_vel.x = vx * 0.2f + 0.02f * (2.0f * Mth::random() - 1.0f);
|
||||
m_vel.y = vy * 0.2f + 0.02f * (2.0f * Mth::random() - 1.0f);
|
||||
m_vel.z = vz * 0.2f + 0.02f * (2.0f * Mth::random() - 1.0f);
|
||||
field_EC = int(8.0f / (Mth::random() * 0.8f + 0.2f));
|
||||
}
|
||||
|
||||
void BubbleParticle::tick()
|
||||
{
|
||||
field_3C = m_pos;
|
||||
|
||||
m_vel.y += 0.002f;
|
||||
move(m_vel.x, m_vel.y, m_vel.z);
|
||||
|
||||
m_vel *= 0.85f;
|
||||
|
||||
if (m_pLevel->getMaterial(Mth::floor(m_pos.x), Mth::floor(m_pos.y), Mth::floor(m_pos.z)) != Material::water)
|
||||
remove();
|
||||
|
||||
field_EC--;
|
||||
if (field_EC <= 0)
|
||||
remove();
|
||||
}
|
||||
Reference in New Issue
Block a user