From 1fcccda0ca9a2b5f3c34cc9077b3349b0c1a16bd Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 10 Jul 2017 20:22:18 +1000 Subject: [PATCH] Remove unused cancel event fields --- MCGalaxy/Levels/Level.Fields.cs | 4 +--- MCGalaxy/Levels/Level.cs | 1 - MCGalaxy/Plugins/Events/Enums.cs | 6 ------ MCGalaxy/Plugins/Plugin.Events.cs | 12 ++---------- MCGalaxy/Server/Server.Fields.cs | 6 +----- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/MCGalaxy/Levels/Level.Fields.cs b/MCGalaxy/Levels/Level.Fields.cs index a60a9b622..4179cd675 100644 --- a/MCGalaxy/Levels/Level.Fields.cs +++ b/MCGalaxy/Levels/Level.Fields.cs @@ -64,9 +64,7 @@ namespace MCGalaxy { } public static bool cancelload; - public static bool cancelsave; - public static bool cancelphysics; - public bool cancelsave1; + public bool cancelsave; public bool cancelunload; public bool changed; internal bool saveLevel = true; diff --git a/MCGalaxy/Levels/Level.cs b/MCGalaxy/Levels/Level.cs index f56417a65..3d060a672 100644 --- a/MCGalaxy/Levels/Level.cs +++ b/MCGalaxy/Levels/Level.cs @@ -241,7 +241,6 @@ namespace MCGalaxy { string path = LevelInfo.MapPath(MapName); if (LevelSave != null) LevelSave(this); OnLevelSaveEvent.Call(this); - if (cancelsave1) { cancelsave1 = false; return; } if (cancelsave) { cancelsave = false; return; } try { diff --git a/MCGalaxy/Plugins/Events/Enums.cs b/MCGalaxy/Plugins/Events/Enums.cs index fdc10160e..5a78d3779 100644 --- a/MCGalaxy/Plugins/Events/Enums.cs +++ b/MCGalaxy/Plugins/Events/Enums.cs @@ -19,11 +19,6 @@ namespace MCGalaxy.Events { /// These are server event that can be canceled public enum ServerEvents { - //TODO - //Make these do things - ServerLog, - ServerOpLog, - ServerAdminLog, ConsoleCommand } @@ -43,7 +38,6 @@ namespace MCGalaxy.Events { /// These are Global (static) level events that can be canceled public enum GlobalLevelEvents { LevelLoad, - LevelSave } /// These are level events that can be canceled diff --git a/MCGalaxy/Plugins/Plugin.Events.cs b/MCGalaxy/Plugins/Plugin.Events.cs index ab2493ce8..b229d8bbc 100644 --- a/MCGalaxy/Plugins/Plugin.Events.cs +++ b/MCGalaxy/Plugins/Plugin.Events.cs @@ -57,9 +57,6 @@ namespace MCGalaxy { public static void CancelServerEvent(ServerEvents e) { switch (e) { case ServerEvents.ConsoleCommand: Server.cancelcommand = true; break; - case ServerEvents.ServerAdminLog: Server.canceladmin = true; break; - case ServerEvents.ServerLog: Server.cancellog = true; break; - case ServerEvents.ServerOpLog: Server.canceloplog = true; break; } } @@ -67,9 +64,6 @@ namespace MCGalaxy { public static bool IsServerEventCanceled(ServerEvents e) { switch (e) { case ServerEvents.ConsoleCommand: return Server.cancelcommand; - case ServerEvents.ServerAdminLog: return Server.canceladmin; - case ServerEvents.ServerLog: return Server.cancellog; - case ServerEvents.ServerOpLog: return Server.canceloplog; } return false; } @@ -79,7 +73,7 @@ namespace MCGalaxy { public static void CancelLevelEvent(LevelEvents e, Level l) { switch (e) { case LevelEvents.LevelUnload: l.cancelunload = true; break; - case LevelEvents.LevelSave: l.cancelsave1 = true; break; + case LevelEvents.LevelSave: l.cancelsave = true; break; } } @@ -87,7 +81,7 @@ namespace MCGalaxy { public static bool IsLevelEventCancel(LevelEvents e, Level l) { switch (e) { case LevelEvents.LevelUnload: return l.cancelunload; - case LevelEvents.LevelSave: return l.cancelsave1; + case LevelEvents.LevelSave: return l.cancelsave; } return false; } @@ -97,7 +91,6 @@ namespace MCGalaxy { public static void CancelGlobalLevelEvent(GlobalLevelEvents e) { switch (e) { case GlobalLevelEvents.LevelLoad: Level.cancelload = true; break; - case GlobalLevelEvents.LevelSave: Level.cancelsave = true; break; } } @@ -105,7 +98,6 @@ namespace MCGalaxy { public static bool IsGlobalLevelEventCanceled(GlobalLevelEvents e) { switch (e) { case GlobalLevelEvents.LevelLoad: return Level.cancelload; - case GlobalLevelEvents.LevelSave: return Level.cancelsave; } return false; } diff --git a/MCGalaxy/Server/Server.Fields.cs b/MCGalaxy/Server/Server.Fields.cs index 21832fe5d..34459cffb 100644 --- a/MCGalaxy/Server/Server.Fields.cs +++ b/MCGalaxy/Server/Server.Fields.cs @@ -24,11 +24,7 @@ using MCGalaxy.Tasks; namespace MCGalaxy { public sealed partial class Server { - public static bool cancelcommand; - public static bool canceladmin; - public static bool cancellog; - public static bool canceloplog; - + public static bool cancelcommand; public delegate void OnConsoleCommand(string cmd, string message); public static event OnConsoleCommand ConsoleCommand; public delegate void MessageEventHandler(string message);