Kill off obsolete methods

This commit is contained in:
UnknownShadow200 2017-10-03 09:49:45 +11:00
parent 55ea39630d
commit 049a0b71f9
6 changed files with 11 additions and 32 deletions

View File

@ -90,11 +90,6 @@ namespace MCGalaxy {
&& block < CpeCount;
}
public static bool RightClick(byte block, bool countAir = false) {
if (countAir && block == Air) return true;
return block >= Water && block <= StillLava;
}
public static bool BuildIn(byte block) {
if (block == Op_Water || block == Op_Lava
|| Props[block].IsPortal || Props[block].IsMessageBlock) return false;
@ -190,11 +185,5 @@ namespace MCGalaxy {
lvl.UpdateBlockHandlers();
}
}
[Obsolete("Use BlockPerms.CanModify()")]
public static bool canPlace(Player p, byte type) { return BlockPerms.UsableBy(p, type); }
[Obsolete("Use BlockPerms.CanModify()")]
public static bool canPlace(LevelPermission perm, byte type) { return BlockPerms.UsableBy(perm, type); }
}
}

View File

@ -53,7 +53,7 @@ namespace MCGalaxy.Commands.CPE {
Entities.UpdateModel(who, model);
if (p != who) {
Player.GlobalMessage(who, who.ColoredName + "'s %Smodel was changed to a &c" + model);
Player.SendChatFrom(who, who.ColoredName + "'s %Smodel was changed to a &c" + model, false);
} else {
Player.Message(who, "Changed your own model to a &c" + model);
}

View File

@ -52,7 +52,7 @@ namespace MCGalaxy.Commands.CPE {
Entities.GlobalRespawn(who);
if (p != who) {
Player.GlobalMessage(who, who.ColoredName + "'s %Sskin was changed to &c" + skin);
Player.SendChatFrom(who, who.ColoredName + "'s %Sskin was changed to &c" + skin, false);
} else {
Player.Message(who, "Changed your own skin to &c" + skin);
}

View File

@ -26,6 +26,11 @@ namespace MCGalaxy.Drawing.Ops {
public override string Name { get { return "Hollow"; } }
public byte Skip;
static bool CanHollow(byte block, bool andAir = false) {
if (andAir && block == Block.Air) return true;
return block >= Block.Water && block <= Block.StillLava;
}
public override void Perform(Vec3S32[] marks, Brush brush, DrawOpOutput output) {
Vec3U16 p1 = Clamp(Min), p2 = Clamp(Max);
ExtBlock air = ExtBlock.Air;
@ -36,7 +41,7 @@ namespace MCGalaxy.Drawing.Ops {
{
bool hollow = true;
byte tile = Level.GetTile(x, y, z);
if (!Block.RightClick(Block.Convert(tile), true) && tile != Skip) {
if (!CanHollow(Block.Convert(tile), true) && tile != Skip) {
CheckTile(x - 1, y, z, ref hollow);
CheckTile(x + 1, y, z, ref hollow);
CheckTile(x, y - 1, z, ref hollow);
@ -53,7 +58,7 @@ namespace MCGalaxy.Drawing.Ops {
void CheckTile(int x, int y, int z, ref bool hollow) {
byte tile = Level.GetTile((ushort)x, (ushort)y, (ushort)z);
if (Block.RightClick(Block.Convert(tile)) || tile == Skip)
if (CanHollow(Block.Convert(tile)) || tile == Skip)
hollow = false;
}
}

View File

@ -149,11 +149,6 @@ namespace MCGalaxy {
}
}
[Obsolete("Use SendChatFrom() instead.")]
public static void GlobalChat(Player from, string message) { SendChatFrom(from, message, true); }
[Obsolete("Use SendChatFrom() instead.")]
public static void GlobalChat(Player from, string message, bool showname) { SendChatFrom(from, message, showname); }
public static void SendChatFrom(Player from, string message) { SendChatFrom(from, message, true); }
public static void SendChatFrom(Player from, string message, bool showname) {
if (from == null) return;
@ -168,11 +163,6 @@ namespace MCGalaxy {
}
public static List<ChatMessage> Last50Chat = new List<ChatMessage>();
[Obsolete("Use Chat.MessageAll() instead")]
public static void GlobalMessage(string message) { Chat.MessageGlobal(message); }
[Obsolete("Use Chat.MessageAll() instead")]
public static void GlobalMessage(string message, bool global) { Chat.MessageGlobal(message); }
public static void GlobalIRCMessage(string srcNick, string message) {
message = Colors.Escape(message);
Player[] players = PlayerInfo.Online.Items;
@ -184,11 +174,6 @@ namespace MCGalaxy {
}
}
public static void GlobalMessage(Player from, string message) {
if (from == null) Chat.MessageGlobal(message);
else SendChatFrom(from, message, false);
}
public bool MarkPossessed(string marker = "") {
if (marker.Length > 0) {
Player controller = PlayerInfo.FindExact(marker);