Antigriefs should be working now, it will check the sorrounding blocks to see if any of them are blocks that fire is not allowed to spread to. Also commented out if statement on announcements to see if it was bugged or not. Added in /colors command so players can see all the colors they can use.

This commit is contained in:
nossr50 2010-12-07 23:57:32 -08:00
parent 8f09d9c428
commit a2027ec991
4 changed files with 33 additions and 10 deletions

View File

@ -20,8 +20,8 @@ public class vMinecraftAnnouncements extends vMinecraftCommands{
return false; return false;
} }
//Only run if the global message feature is enabled //Only run if the global message feature is enabled
if(vMinecraftSettings.getInstance().globalmessages()) //if(vMinecraftSettings.getInstance().globalmessages())
{ //{
//Global messages that should only parse when a command can be successful //Global messages that should only parse when a command can be successful
if(split[0].equalsIgnoreCase("/kick")) { if(split[0].equalsIgnoreCase("/kick")) {
Player playerTarget = etc.getServer().matchPlayer(split[1]); Player playerTarget = etc.getServer().matchPlayer(split[1]);
@ -52,7 +52,7 @@ public class vMinecraftAnnouncements extends vMinecraftCommands{
vMinecraftChat.gmsg(player, player.getName() + Colors.Blue+" has teleported to " + etc.getServer().getPlayer(split[1]).getName()); vMinecraftChat.gmsg(player, player.getName() + Colors.Blue+" has teleported to " + etc.getServer().getPlayer(split[1]).getName());
} }
} }
} //}
return true; return true;
} }

View File

@ -29,6 +29,7 @@ public class vMinecraftCommands{
public static void loadCommands(){ public static void loadCommands(){
//If we had commands we would add them here. //If we had commands we would add them here.
cl.register("/tp", "teleport"); cl.register("/tp", "teleport");
cl.register("/colors", "colors");
cl.register("/masstp", "masstp", "Teleports those with lower permissions to you"); cl.register("/masstp", "masstp", "Teleports those with lower permissions to you");
cl.register("/reload", "reload"); cl.register("/reload", "reload");
cl.register("/rules", "rules", "Displays the rules"); cl.register("/rules", "rules", "Displays the rules");
@ -52,7 +53,18 @@ public class vMinecraftCommands{
cl.registerAlias("/wrists", "/suicide"); cl.registerAlias("/wrists", "/suicide");
cl.registerAlias("/ci", "/clearinventory"); cl.registerAlias("/ci", "/clearinventory");
} }
//=====================================================================
//Function: colors (/colors)
//Input: Player player: The player using the command
//Output: int: Exit Code
//Use: Displays a list of all colors and color codes
//=====================================================================
public static int colors(Player player, String[] args){
vMinecraftChat.sendMessage(player, player, Colors.Black + "0" + Colors.Navy + "1" + Colors.Green+ "2" + Colors.Blue + "3" + Colors.Red + "4" + Colors.Purple + "5" + Colors.Gold + "6" + Colors.LightGray + "7" + Colors.Gray + "8" + Colors.DarkPurple + "9" + Colors.LightGreen + "a" + Colors.LightBlue + "b" + Colors.Rose + "c" + Colors.LightPurple + "d" + Colors.White + "f");
return EXIT_SUCCESS;
}
//===================================================================== //=====================================================================
//Function: me (/me) //Function: me (/me)
//Input: Player player: The player using the command //Input: Player player: The player using the command

View File

@ -1,5 +1,6 @@
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.Set;
//===================================================================== //=====================================================================
//Class: vMinecraftListener //Class: vMinecraftListener
//Use: The listener to catch incoming chat and commands //Use: The listener to catch incoming chat and commands
@ -93,7 +94,17 @@ public class vMinecraftListener extends PluginListener {
public boolean onIgnite(Block block, Player player) { public boolean onIgnite(Block block, Player player) {
if(vMinecraftSettings.stopFire){ if(vMinecraftSettings.stopFire){
if (vMinecraftSettings.fireNoSpread.contains(block)){ int x = block.getX();
int y = block.getY();
int z = block.getZ();
if (vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x + 1, y, z))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x - 1, y, z))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x, y + 1, z))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x, y - 1, z))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x, y, z + 1))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x, y, z - 1))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x + 1, y + 1, z + 1))
|| vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x - 1, y - 1, z - 1))) {
return true; return true;
} }
} }

View File

@ -1,6 +1,7 @@
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.Set;
import java.util.logging.Logger; import java.util.logging.Logger;
//===================================================================== //=====================================================================
//Class: vminecraftSettings //Class: vminecraftSettings
@ -10,7 +11,9 @@ import java.util.logging.Logger;
public class vMinecraftSettings { public class vMinecraftSettings {
//private final static Object syncLock = new Object(); //private final static Object syncLock = new Object();
protected static final Logger log = Logger.getLogger("Minecraft"); protected static final Logger log = Logger.getLogger("Minecraft");
private static volatile vMinecraftSettings instance; private static volatile vMinecraftSettings instance;
//The block IDs fire won't spread to will be stored here
public static Set<Integer> fireNoSpread;
//The feature settings //The feature settings
@ -41,7 +44,7 @@ public class vMinecraftSettings {
//An array of players currently toggled for admin chat //An array of players currently toggled for admin chat
static ArrayList<String> adminChatList = new ArrayList<String>(); static ArrayList<String> adminChatList = new ArrayList<String>();
//An array of blocks that won't catch on fire //An array of blocks that won't catch on fire
static ArrayList<String> fireNoSpread = new ArrayList<String>();
private PropertiesFile properties; private PropertiesFile properties;
@ -87,8 +90,6 @@ public class vMinecraftSettings {
writer.write("cmdEzModo=true\r\n"); writer.write("cmdEzModo=true\r\n");
writer.write("#Adding player names to this list will have them start off in ezmodo\r\n"); writer.write("#Adding player names to this list will have them start off in ezmodo\r\n");
writer.write("ezModo=\r\n"); writer.write("ezModo=\r\n");
writer.write("#The health ezmodo people will have while in ezmodo. Don't set to 0\r\n");
writer.write("ezHealth=30\r\n");
writer.write("stopFire=false\r\n"); writer.write("stopFire=false\r\n");
writer.write("#Flame Immune blocks will never have fire spread to them, seperate with comma. Needs stopFire to be true\r\n"); writer.write("#Flame Immune blocks will never have fire spread to them, seperate with comma. Needs stopFire to be true\r\n");
writer.write("fireNoSpread=5,17,18"); writer.write("fireNoSpread=5,17,18");
@ -141,7 +142,6 @@ public class vMinecraftSettings {
stopTnt = properties.getBoolean("stopTNT",true); stopTnt = properties.getBoolean("stopTNT",true);
rules = properties.getString("rules", "").split("@"); rules = properties.getString("rules", "").split("@");
deathMessages = properties.getString("deathmessages", "").split(","); deathMessages = properties.getString("deathmessages", "").split(",");
fireNoSpread.add(properties.getString("fireNoSpread", "").split(",").toString());
String[] tempEz = properties.getString("ezModo").split(","); String[] tempEz = properties.getString("ezModo").split(",");
ezModo = new ArrayList<String>(); ezModo = new ArrayList<String>();
for(String ezName : tempEz) for(String ezName : tempEz)