mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
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:
parent
c72f521827
commit
bf7c54c618
@ -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) {
|
||||
|
@ -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:
|
||||
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.");
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user