mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
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:
parent
8f09d9c428
commit
a2027ec991
@ -20,8 +20,8 @@ public class vMinecraftAnnouncements extends vMinecraftCommands{
|
||||
return false;
|
||||
}
|
||||
//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
|
||||
if(split[0].equalsIgnoreCase("/kick")) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ public class vMinecraftCommands{
|
||||
public static void loadCommands(){
|
||||
//If we had commands we would add them here.
|
||||
cl.register("/tp", "teleport");
|
||||
cl.register("/colors", "colors");
|
||||
cl.register("/masstp", "masstp", "Teleports those with lower permissions to you");
|
||||
cl.register("/reload", "reload");
|
||||
cl.register("/rules", "rules", "Displays the rules");
|
||||
@ -53,6 +54,17 @@ public class vMinecraftCommands{
|
||||
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)
|
||||
//Input: Player player: The player using the command
|
||||
|
@ -1,5 +1,6 @@
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.Set;
|
||||
//=====================================================================
|
||||
//Class: vMinecraftListener
|
||||
//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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
//=====================================================================
|
||||
//Class: vminecraftSettings
|
||||
@ -11,6 +12,8 @@ public class vMinecraftSettings {
|
||||
//private final static Object syncLock = new Object();
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
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
|
||||
@ -41,7 +44,7 @@ public class vMinecraftSettings {
|
||||
//An array of players currently toggled for admin chat
|
||||
static ArrayList<String> adminChatList = new ArrayList<String>();
|
||||
//An array of blocks that won't catch on fire
|
||||
static ArrayList<String> fireNoSpread = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
private PropertiesFile properties;
|
||||
@ -87,8 +90,6 @@ public class vMinecraftSettings {
|
||||
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("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("#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");
|
||||
@ -141,7 +142,6 @@ public class vMinecraftSettings {
|
||||
stopTnt = properties.getBoolean("stopTNT",true);
|
||||
rules = properties.getString("rules", "").split("@");
|
||||
deathMessages = properties.getString("deathmessages", "").split(",");
|
||||
fireNoSpread.add(properties.getString("fireNoSpread", "").split(",").toString());
|
||||
String[] tempEz = properties.getString("ezModo").split(",");
|
||||
ezModo = new ArrayList<String>();
|
||||
for(String ezName : tempEz)
|
||||
|
Loading…
Reference in New Issue
Block a user