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.
2.5 kB · 120 lines
C++
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120#include "stdafx.h"#include "net.minecraft.world.scores.h"#include "PlayerTeam.h"
PlayerTeam::PlayerTeam(Scoreboard *scoreboard, const wstring &name){ this->scoreboard = scoreboard; this->name = name; displayName = name;
prefix = L""; suffix = L""; allowFriendlyFire = true; seeFriendlyInvisibles = true;}
Scoreboard *PlayerTeam::getScoreboard(){ return scoreboard;}
wstring PlayerTeam::getName(){ return name;}
wstring PlayerTeam::getDisplayName(){ return displayName;}
void PlayerTeam::setDisplayName(const wstring &displayName){ //if (displayName == null) throw new IllegalArgumentException("Name cannot be null"); this->displayName = displayName; scoreboard->onTeamChanged(this);}
unordered_set<wstring> *PlayerTeam::getPlayers(){ return &players;}
wstring PlayerTeam::getPrefix(){ return prefix;}
void PlayerTeam::setPrefix(const wstring &prefix){ //if (prefix == null) throw new IllegalArgumentException("Prefix cannot be null"); this->prefix = prefix; scoreboard->onTeamChanged(this);}
wstring PlayerTeam::getSuffix(){ return suffix;}
void PlayerTeam::setSuffix(const wstring &suffix){ //if (suffix == null) throw new IllegalArgumentException("Suffix cannot be null"); this->suffix = suffix; scoreboard->onTeamChanged(this);}
wstring PlayerTeam::getFormattedName(const wstring &teamMemberName){ return getPrefix() + teamMemberName + getSuffix();}
wstring PlayerTeam::formatNameForTeam(PlayerTeam *team){ return formatNameForTeam(team, team->getDisplayName());}
wstring PlayerTeam::formatNameForTeam(Team *team, const wstring &name){ if (team == NULL) return name; return team->getFormattedName(name);}
bool PlayerTeam::isAllowFriendlyFire(){ return allowFriendlyFire;}
void PlayerTeam::setAllowFriendlyFire(bool allowFriendlyFire){ this->allowFriendlyFire = allowFriendlyFire; scoreboard->onTeamChanged(this);}
bool PlayerTeam::canSeeFriendlyInvisibles(){ return seeFriendlyInvisibles;}
void PlayerTeam::setSeeFriendlyInvisibles(bool seeFriendlyInvisibles){ this->seeFriendlyInvisibles = seeFriendlyInvisibles; scoreboard->onTeamChanged(this);}
int PlayerTeam::packOptions(){ int result = 0;
if (isAllowFriendlyFire()) result |= 1 << BIT_FRIENDLY_FIRE; if (canSeeFriendlyInvisibles()) result |= 1 << BIT_SEE_INVISIBLES;
return result;}
void PlayerTeam::unpackOptions(int options){ setAllowFriendlyFire((options & (1 << BIT_FRIENDLY_FIRE)) > 0); setSeeFriendlyInvisibles((options & (1 << BIT_SEE_INVISIBLES)) > 0);}