mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix not being able to use some commands in a /mb even when you should be able to. (Thanks xnotx123)
This commit is contained in:
parent
11743532cd
commit
88bfba87c2
@ -97,7 +97,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
Command.Search(ref alias, ref cmdArgs);
|
||||
|
||||
foreach (Command cmd in Command.all.commands) {
|
||||
if (cmd.defaultRank <= p.Rank && (allCmds || !cmd.type.Contains("mod"))) continue;
|
||||
if (p.group.CanExecute(cmd) && (allCmds || !cmd.type.Contains("mod"))) continue;
|
||||
|
||||
if (IsCommand(message, cmd.name) || IsCommand(alias, cmd.name)) {
|
||||
p.SendMessage("You cannot use that command in a messageblock."); return false;
|
||||
|
@ -16,8 +16,7 @@
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MCGalaxy.Blocks.Physics;
|
||||
using MCGalaxy.DB;
|
||||
using MCGalaxy.Drawing.Brushes;
|
||||
using MCGalaxy.Undo;
|
||||
|
||||
@ -33,6 +32,10 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
/// <summary> Point in time that the /undo should start updating blocks. </summary>
|
||||
public DateTime End = DateTime.MaxValue;
|
||||
|
||||
public RedoSelfDrawOp() {
|
||||
Flags = BlockDBFlags.RedoSelf;
|
||||
}
|
||||
|
||||
public override long BlocksAffected(Level lvl, Vec3S32[] marks) { return -1; }
|
||||
|
||||
public override void Perform(Vec3S32[] marks, Brush brush, Action<DrawOpBlock> output) {
|
||||
|
@ -15,15 +15,20 @@
|
||||
or implied. See the Licenses for the specific language governing
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MCGalaxy.Blocks.Physics;
|
||||
using MCGalaxy.Drawing.Brushes;
|
||||
using MCGalaxy.Undo;
|
||||
using System;
|
||||
using MCGalaxy.Blocks.Physics;
|
||||
using MCGalaxy.DB;
|
||||
using MCGalaxy.Drawing.Brushes;
|
||||
using MCGalaxy.Undo;
|
||||
|
||||
namespace MCGalaxy.Drawing.Ops {
|
||||
|
||||
public class UndoSelfDrawOp : UndoOnlineDrawOp {
|
||||
|
||||
public UndoSelfDrawOp() {
|
||||
Flags = BlockDBFlags.UndoSelf;
|
||||
}
|
||||
|
||||
public override string Name { get { return "UndoSelf"; } }
|
||||
}
|
||||
|
||||
@ -39,13 +44,17 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
|
||||
internal Player who;
|
||||
|
||||
public UndoOnlineDrawOp() {
|
||||
Flags = BlockDBFlags.UndoOther;
|
||||
}
|
||||
|
||||
public override long BlocksAffected(Level lvl, Vec3S32[] marks) { return -1; }
|
||||
|
||||
public override void Perform(Vec3S32[] marks, Brush brush, Action<DrawOpBlock> output) {
|
||||
UndoCache cache = who.UndoBuffer;
|
||||
using (IDisposable locker = cache.ClearLock.AccquireReadLock()) {
|
||||
if (UndoBlocks(Player, who)) return;
|
||||
}
|
||||
}
|
||||
bool found = false;
|
||||
string target = who.name.ToLower();
|
||||
|
||||
@ -69,7 +78,7 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
}
|
||||
}
|
||||
|
||||
public class UndoOfflineDrawOp : DrawOp {
|
||||
public class UndoOfflineDrawOp : DrawOp {
|
||||
public override string Name { get { return "UndoOffline"; } }
|
||||
public override bool AffectedByTransform { get { return false; } }
|
||||
|
||||
@ -79,6 +88,10 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
internal string whoName;
|
||||
internal bool found = false;
|
||||
|
||||
public UndoOfflineDrawOp() {
|
||||
Flags = BlockDBFlags.UndoOther;
|
||||
}
|
||||
|
||||
public override long BlocksAffected(Level lvl, Vec3S32[] marks) { return -1; }
|
||||
|
||||
public override void Perform(Vec3S32[] marks, Brush brush, Action<DrawOpBlock> output) {
|
||||
@ -90,7 +103,7 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
}
|
||||
}
|
||||
|
||||
public class UndoPhysicsDrawOp : DrawOp {
|
||||
public class UndoPhysicsDrawOp : DrawOp {
|
||||
public override string Name { get { return "UndoPhysics"; } }
|
||||
public override bool AffectedByTransform { get { return false; } }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user