the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 39 lines 1.1 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.entity.h" 3#include "net.minecraft.world.entity.player.h" 4#include "net.minecraft.world.level.h" 5#include "MinecartRideable.h" 6 7 8MinecartRideable::MinecartRideable(Level *level) : Minecart(level) 9{ 10 11 // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that 12 // the derived version of the function is called 13 this->defineSynchedData(); 14} 15 16MinecartRideable::MinecartRideable(Level *level, double x, double y, double z) : Minecart(level, x, y, z) 17{ 18 19 // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that 20 // the derived version of the function is called 21 this->defineSynchedData(); 22} 23 24bool MinecartRideable::interact(shared_ptr<Player> player) 25{ 26 if (rider.lock() != NULL && rider.lock()->instanceof(eTYPE_PLAYER) && rider.lock() != player) return true; 27 if (rider.lock() != NULL && rider.lock() != player) return false; 28 if (!level->isClientSide) 29 { 30 player->ride(shared_from_this()); 31 } 32 33 return true; 34} 35 36int MinecartRideable::getType() 37{ 38 return TYPE_RIDEABLE; 39}