mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
Make /b show contents of a /mb.
This commit is contained in:
parent
2b49c1adee
commit
9d390d88d9
@ -76,8 +76,9 @@ namespace MCGalaxy.Commands {
|
|||||||
Output(p, user, block, deleted, now - time);
|
Output(p, user, block, deleted, now - time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!foundOne)
|
if (!foundOne) Player.Message(p, "No block change records found for this block.");
|
||||||
Player.Message(p, "No block change records found for this block.");
|
OutputMessageBlock(p, b, x, y, z);
|
||||||
|
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
GC.WaitForPendingFinalizers();
|
GC.WaitForPendingFinalizers();
|
||||||
}
|
}
|
||||||
@ -89,6 +90,23 @@ namespace MCGalaxy.Commands {
|
|||||||
deleted ? "&4deleted%S (using " + bName + ")" : "&3placed%S " + bName);
|
deleted ? "&4deleted%S (using " + bName + ")" : "&3placed%S " + bName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OutputMessageBlock(Player p, byte block, ushort x, ushort y, ushort z) {
|
||||||
|
if (!Block.Props[block].IsMessageBlock) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
//safe against SQL injections because no user input is given here
|
||||||
|
DataTable Messages = Database.Fill("SELECT * FROM `Messages" + p.level.name +
|
||||||
|
"` WHERE X=@0 AND Y=@1 AND Z=@2", x, y, z);
|
||||||
|
int last = Messages.Rows.Count - 1;
|
||||||
|
if (last == -1) { Messages.Dispose(); return; }
|
||||||
|
|
||||||
|
string message = Messages.Rows[last]["Message"].ToString().Trim();
|
||||||
|
message = message.Replace("\\'", "\'");
|
||||||
|
Player.Message(p, "Message Block contents: " + message);
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
Player.Message(p, "%T/about");
|
Player.Message(p, "%T/about");
|
||||||
Player.Message(p, "%HOutputs the change/edit history for a block.");
|
Player.Message(p, "%HOutputs the change/edit history for a block.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user