Fix bug where drawops showed wrong blocks to some players

This happened if player A joined (using classic mode), then B joined (using enhanced mode), then B tried drawing a cuboid with custom blocks. The fallback blocks would be shown to both players.
This commit is contained in:
UnknownShadow200 2017-08-14 23:23:21 +10:00
parent c72f521827
commit bf7c54c618
3 changed files with 19 additions and 19 deletions

View File

@ -35,18 +35,18 @@ namespace MCGalaxy.Commands.Moderation {
public override void Use(Player p, string message) {
string[] args = message.SplitSpaces(3);
if (args.Length < 2) { Help(p); return; }
string rank = null, name = null;
string rankName = null, name = null;
string reason = args.Length > 2 ? args[2] : null;
if (args[0].CaselessEq("+up")) {
rank = args[0];
rankName = args[0];
name = ModActionCmd.FindName(p, "promote", "Promote", "", args[1], ref reason);
} else if (args[0].CaselessEq("-down")) {
rank = args[0];
rankName = args[0];
name = ModActionCmd.FindName(p, "demote", "Demote", "", args[1], ref reason);
} else {
rank = args[1];
name = ModActionCmd.FindName(p, "rank", "Rank", " " + rank, args[0], ref reason);
rankName = args[1];
name = ModActionCmd.FindName(p, "rank", "Rank", " " + rankName, args[0], ref reason);
}
if (name == null) return;
@ -54,7 +54,7 @@ namespace MCGalaxy.Commands.Moderation {
if (p == who && who != null) { Player.Message(p, "Cannot change your own rank."); return; }
Group curRank = who != null ? who.group : PlayerInfo.GetGroup(name);
Group newRank = TargetRank(p, rank.ToLower(), curRank);
Group newRank = TargetRank(p, rankName, curRank);
if (newRank == null) return;
if (curRank == newRank) {

View File

@ -31,21 +31,21 @@ namespace MCGalaxy.Commands.World {
int totalFixed = 0;
Level lvl = p.level;
if (!lvl.BuildAccess.CheckDetailed(p)) {
Player.Message(p, "Hence you cannot use /fixgrass on this map"); return;
Player.Message(p, "Hence you cannot use %T/fixgrass %Son this map"); return;
}
switch (message.ToLower()) {
case "":
FixDirtAndGrass(p, lvl, ref totalFixed); break;
case "light":
FixLight(p, lvl, ref totalFixed); break;
case "grass":
FixGrass(p, lvl, ref totalFixed); break;
case "dirt":
FixDirt(p, lvl, ref totalFixed); break;
default:
Help(p); return;
if (message.Length == 0) {
FixDirtAndGrass(p, lvl, ref totalFixed);
} else if (message.CaselessEq("light")) {
FixLight(p, lvl, ref totalFixed);
} else if (message.CaselessEq("grass")) {
FixGrass(p, lvl, ref totalFixed);
} else if (message.CaselessEq("dirt")) {
FixDirt(p, lvl, ref totalFixed);
} else {
Help(p); return;
}
Player.Message(p, "Fixed " + totalFixed + " blocks.");
}

View File

@ -164,7 +164,7 @@ namespace MCGalaxy.Network {
data[j++] = (byte)(x >> 8); data[j++] = (byte)x;
data[j++] = (byte)(y >> 8); data[j++] = (byte)y;
data[j++] = (byte)(z >> 8); data[j++] = (byte)z;
data[j++] = types[i] = Block.ConvertCPE(level.RawFallback(types[i]));
data[j++] = Block.ConvertCPE(level.RawFallback(types[i]));
}
return data;
}