forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
50
src/world/entity/projectile/Snowball.h
Executable file
50
src/world/entity/projectile/Snowball.h
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
#ifndef NET_MINECRAFT_WORLD_ENTITY_PROJECTILE__Snowball_H__
|
||||
#define NET_MINECRAFT_WORLD_ENTITY_PROJECTILE__Snowball_H__
|
||||
|
||||
//package net.minecraft.world.entity->projectile;
|
||||
|
||||
#include "Throwable.h"
|
||||
#include "../Mob.h"
|
||||
#include "../../level/Level.h"
|
||||
#include "../../phys/HitResult.h"
|
||||
|
||||
class Snowball: public Throwable
|
||||
{
|
||||
typedef Throwable super;
|
||||
public:
|
||||
Snowball(Level* level)
|
||||
: super(level)
|
||||
{
|
||||
entityRendererId = ER_SNOWBALL_RENDERER;
|
||||
}
|
||||
|
||||
Snowball(Level* level, Mob* mob)
|
||||
: super(level, mob)
|
||||
{
|
||||
entityRendererId = ER_SNOWBALL_RENDERER;
|
||||
}
|
||||
|
||||
Snowball(Level* level, float x, float y, float z)
|
||||
: super(level, x, y, z)
|
||||
{
|
||||
entityRendererId = ER_SNOWBALL_RENDERER;
|
||||
}
|
||||
|
||||
virtual int getEntityTypeId() const {
|
||||
return EntityTypes::IdSnowball;
|
||||
}
|
||||
|
||||
/*@Override*/
|
||||
void onHit(const HitResult& res) {
|
||||
if (res.type == ENTITY)
|
||||
res.entity->hurt(this, 0);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
level->addParticle(PARTICLETYPE(snowballpoof), x, y, z, 0, 0, 0);
|
||||
|
||||
if (!level->isClientSide)
|
||||
remove();
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_WORLD_ENTITY_PROJECTILE__Snowball_H__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue