Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
1.7 kB · 80 lines
C++
at master
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980#include "stdafx.h"#include "net.minecraft.h"#include "net.minecraft.world.phys.h"#include "net.minecraft.world.damagesource.h"#include "net.minecraft.world.level.tile.h"#include "net.minecraft.world.level.h"#include "SmallFireball.h"
SmallFireball::SmallFireball(Level *level) : Fireball(level){ setSize(5 / 16.0f, 5 / 16.0f);}
SmallFireball::SmallFireball(Level *level, shared_ptr<LivingEntity> mob, double xa, double ya, double za) : Fireball(level, mob, xa, ya, za){ setSize(5 / 16.0f, 5 / 16.0f);}
SmallFireball::SmallFireball(Level *level, double x, double y, double z, double xa, double ya, double za) : Fireball(level, x, y, z, xa, ya, za){ setSize(5 / 16.0f, 5 / 16.0f);}
void SmallFireball::onHit(HitResult *res){ if (!level->isClientSide) { if (res->entity != NULL) { DamageSource *damageSource = DamageSource::fireball(dynamic_pointer_cast<Fireball>(shared_from_this()),owner); if (!res->entity->isFireImmune() && res->entity->hurt(damageSource, 5)) { res->entity->setOnFire(5); } delete damageSource; } else { int tileX = res->x; int tileY = res->y; int tileZ = res->z; switch (res->f) { case Facing::UP: tileY++; break; case Facing::DOWN: tileY--; break; case Facing::NORTH: tileZ--; break; case Facing::SOUTH: tileZ++; break; case Facing::EAST: tileX++; break; case Facing::WEST: tileX--; break; }; if (level->isEmptyTile(tileX, tileY, tileZ)) { level->setTileAndUpdate(tileX, tileY, tileZ, Tile::fire_Id); } } remove(); }}
bool SmallFireball::isPickable(){ return false;}
bool SmallFireball::hurt(DamageSource *source, float damage){ return false;}