Made fire stopping simpler and functional.

This commit is contained in:
nossr50 2010-12-08 00:21:01 -08:00
parent a2027ec991
commit 891b7d0f43
2 changed files with 4 additions and 17 deletions

View File

@ -1,6 +1,5 @@
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
@ -94,17 +93,10 @@ 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){
int x = block.getX(); if(block.getStatus() == 3 || block.getStatus() == 1){
int y = block.getY(); return true;
int z = block.getZ(); }
if (vMinecraftSettings.fireNoSpread.contains(etc.getServer().getBlockIdAt(x + 1, y, z)) if(block.getStatus() == 2 && !player.isAdmin()){
|| 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,7 +1,6 @@
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
@ -12,8 +11,6 @@ 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
@ -91,8 +88,6 @@ public class vMinecraftSettings {
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("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("fireNoSpread=5,17,18");
writer.write("stopTnt=false\r\n"); writer.write("stopTnt=false\r\n");
writer.write("rules=Rules@#1: No griefing@#2: No griefing\r\n"); writer.write("rules=Rules@#1: No griefing@#2: No griefing\r\n");
writer.write("#Death messages, seperate them by comma. All death messages start with the player name and a space.\r\n"); writer.write("#Death messages, seperate them by comma. All death messages start with the player name and a space.\r\n");