mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-08 18:46:36 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -6,18 +6,18 @@
|
||||
#include "SnowballItem.h"
|
||||
#include "../Util/SoundTypes.h"
|
||||
|
||||
SnowballItem::SnowballItem(int id) : Item(id)
|
||||
{
|
||||
this->maxStackSize = 16;
|
||||
}
|
||||
SnowballItem::SnowballItem(int id) : Item(id) { this->maxStackSize = 16; }
|
||||
|
||||
std::shared_ptr<ItemInstance> SnowballItem::use(std::shared_ptr<ItemInstance> instance, Level *level, std::shared_ptr<Player> player)
|
||||
{
|
||||
if (!player->abilities.instabuild)
|
||||
{
|
||||
instance->count--;
|
||||
}
|
||||
level->playSound((std::shared_ptr<Entity> ) player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
|
||||
if (!level->isClientSide) level->addEntity( std::shared_ptr<Snowball>( new Snowball(level, player) ) );
|
||||
std::shared_ptr<ItemInstance> SnowballItem::use(
|
||||
std::shared_ptr<ItemInstance> instance, Level* level,
|
||||
std::shared_ptr<Player> player) {
|
||||
if (!player->abilities.instabuild) {
|
||||
instance->count--;
|
||||
}
|
||||
level->playSound((std::shared_ptr<Entity>)player, eSoundType_RANDOM_BOW,
|
||||
0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
|
||||
if (!level->isClientSide)
|
||||
level->addEntity(
|
||||
std::shared_ptr<Snowball>(new Snowball(level, player)));
|
||||
return instance;
|
||||
}
|
||||
Reference in New Issue
Block a user