mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Made fire stopping simpler and functional.
This commit is contained in:
parent
a2027ec991
commit
891b7d0f43
@ -1,6 +1,5 @@
|
||||
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
|
||||
@ -94,17 +93,10 @@ public class vMinecraftListener extends PluginListener {
|
||||
|
||||
public boolean onIgnite(Block block, Player player) {
|
||||
if(vMinecraftSettings.stopFire){
|
||||
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))) {
|
||||
if(block.getStatus() == 3 || block.getStatus() == 1){
|
||||
return true;
|
||||
}
|
||||
if(block.getStatus() == 2 && !player.isAdmin()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
//=====================================================================
|
||||
//Class: vminecraftSettings
|
||||
@ -12,8 +11,6 @@ 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
|
||||
@ -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("ezModo=\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("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");
|
||||
|
Loading…
Reference in New Issue
Block a user