Entity rotations work with players now

This commit is contained in:
UnknownShadow200 2017-04-19 17:29:41 +10:00
parent 670449e4e1
commit b428a54b9a
4 changed files with 19 additions and 12 deletions

View File

@ -51,12 +51,8 @@ namespace MCGalaxy.Commands.CPE {
if (!ParseArgs(p, args, 1, ref prop, ref angle)) return; if (!ParseArgs(p, args, 1, ref prop, ref angle)) return;
Entities.UpdateEntityProp(who, prop, angle); Entities.UpdateEntityProp(who, prop, angle);
/*if (model != "humanoid") { Server.rotations.AddOrReplace(who.name, who.Rot.RotX + " " + who.Rot.RotZ);
Server.models.AddOrReplace(who.name, model); Server.rotations.Save();
} else {
Server.models.Remove(who.name);
}
Server.models.Save();*/
} }
static bool ParseArgs(Player p, string[] args, int i, ref EntityProp prop, ref int angle) { static bool ParseArgs(Player p, string[] args, int i, ref EntityProp prop, ref int angle) {

View File

@ -176,12 +176,22 @@ namespace MCGalaxy {
} }
void LoadCpeData() { void LoadCpeData() {
string savedSkin = Server.skins.FindData(name); string skin = Server.skins.FindData(name);
if (savedSkin != null) SkinName = savedSkin; if (skin != null) SkinName = skin;
string savedModel = Server.models.FindData(name); string model = Server.models.FindData(name);
if (savedModel != null) Model = savedModel; if (model != null) Model = model;
ModelBB = AABB.ModelAABB(Model, level); ModelBB = AABB.ModelAABB(Model, level);
string rotations = Server.rotations.FindData(name);
if (rotations == null) return;
string[] rotParts = rotations.SplitSpaces(2);
if (rotParts.Length != 2) return;
Orientation rot = Rot;
byte.TryParse(rotParts[0], out rot.RotX);
byte.TryParse(rotParts[1], out rot.RotZ);
Rot = rot;
} }
void InitPlayerStats(DataTable playerDb) { void InitPlayerStats(DataTable playerDb) {
@ -200,7 +210,7 @@ namespace MCGalaxy {
muted = true; muted = true;
Chat.MessageGlobal(this, DisplayName + " &cis still muted from previously.", false); Chat.MessageGlobal(this, DisplayName + " &cis still muted from previously.", false);
} }
if (Server.frozen.Contains(name)) { if (Server.frozen.Contains(name)) {
frozen = true; frozen = true;
Chat.MessageGlobal(this, DisplayName + " &cis still frozen from previously.", false); Chat.MessageGlobal(this, DisplayName + " &cis still frozen from previously.", false);

View File

@ -93,7 +93,7 @@ namespace MCGalaxy {
public static CTFGame ctf = null; public static CTFGame ctf = null;
public static PlayerList bannedIP, whiteList, ircControllers, muted, invalidIds; public static PlayerList bannedIP, whiteList, ircControllers, muted, invalidIds;
public static PlayerList ignored, frozen, hidden, agreed, vip, noEmotes, lockdown; public static PlayerList ignored, frozen, hidden, agreed, vip, noEmotes, lockdown;
public static PlayerExtList jailed, models, skins, reach, tempBans; public static PlayerExtList jailed, models, skins, reach, tempBans, rotations;
public static readonly List<string> Devs = new List<string>(), Mods = new List<string>(); public static readonly List<string> Devs = new List<string>(), Mods = new List<string>();

View File

@ -72,6 +72,7 @@ namespace MCGalaxy {
reach = PlayerExtList.Load("extra/reach.txt"); reach = PlayerExtList.Load("extra/reach.txt");
invalidIds = PlayerList.Load("extra/invalidids.txt"); invalidIds = PlayerList.Load("extra/invalidids.txt");
tempBans = PlayerExtList.Load("text/tempbans.txt"); tempBans = PlayerExtList.Load("text/tempbans.txt");
rotations = PlayerExtList.Load("extra/rotations.txt");
if (useWhitelist) if (useWhitelist)
whiteList = PlayerList.Load("whitelist.txt"); whiteList = PlayerList.Load("whitelist.txt");