Merge remote-tracking branch 'origin/master' into CustomFactionEvents
This commit is contained in:
commit
88bdadcb2b
@ -3,7 +3,7 @@ package com.massivecraft.factions;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.entity.CreatureType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import com.massivecraft.factions.struct.FFlag;
|
import com.massivecraft.factions.struct.FFlag;
|
||||||
import com.massivecraft.factions.struct.FPerm;
|
import com.massivecraft.factions.struct.FPerm;
|
||||||
@ -155,7 +155,7 @@ public class Conf
|
|||||||
//public static Set<Material> territoryDenyUseageMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
//public static Set<Material> territoryDenyUseageMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
||||||
|
|
||||||
// TODO: Rename to monsterCreatureTypes
|
// TODO: Rename to monsterCreatureTypes
|
||||||
public static transient Set<CreatureType> monsters = EnumSet.noneOf(CreatureType.class);
|
public static transient Set<EntityType> monsters = EnumSet.noneOf(EntityType.class);
|
||||||
|
|
||||||
// Spout features
|
// Spout features
|
||||||
public static boolean spoutFactionTagsOverNames = true; // show faction tags over names over player heads
|
public static boolean spoutFactionTagsOverNames = true; // show faction tags over names over player heads
|
||||||
@ -268,20 +268,20 @@ public class Conf
|
|||||||
materialsEditTools.add(Material.WATER_BUCKET);
|
materialsEditTools.add(Material.WATER_BUCKET);
|
||||||
materialsEditTools.add(Material.LAVA_BUCKET);
|
materialsEditTools.add(Material.LAVA_BUCKET);
|
||||||
|
|
||||||
monsters.add(CreatureType.BLAZE);
|
monsters.add(EntityType.BLAZE);
|
||||||
monsters.add(CreatureType.CAVE_SPIDER);
|
monsters.add(EntityType.CAVE_SPIDER);
|
||||||
monsters.add(CreatureType.CREEPER);
|
monsters.add(EntityType.CREEPER);
|
||||||
monsters.add(CreatureType.ENDERMAN);
|
monsters.add(EntityType.ENDERMAN);
|
||||||
monsters.add(CreatureType.ENDER_DRAGON);
|
monsters.add(EntityType.ENDER_DRAGON);
|
||||||
monsters.add(CreatureType.GHAST);
|
monsters.add(EntityType.GHAST);
|
||||||
monsters.add(CreatureType.GIANT);
|
monsters.add(EntityType.GIANT);
|
||||||
monsters.add(CreatureType.MAGMA_CUBE);
|
monsters.add(EntityType.MAGMA_CUBE);
|
||||||
monsters.add(CreatureType.PIG_ZOMBIE);
|
monsters.add(EntityType.PIG_ZOMBIE);
|
||||||
monsters.add(CreatureType.SILVERFISH);
|
monsters.add(EntityType.SILVERFISH);
|
||||||
monsters.add(CreatureType.SKELETON);
|
monsters.add(EntityType.SKELETON);
|
||||||
monsters.add(CreatureType.SLIME);
|
monsters.add(EntityType.SLIME);
|
||||||
monsters.add(CreatureType.SPIDER);
|
monsters.add(EntityType.SPIDER);
|
||||||
monsters.add(CreatureType.ZOMBIE);
|
monsters.add(EntityType.ZOMBIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -78,7 +78,8 @@ public class P extends MPlugin
|
|||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
if ( ! preEnable()) return;
|
if ( ! preEnable()) return;
|
||||||
|
this.loadSuccessful = false;
|
||||||
|
|
||||||
// Load Conf from disk
|
// Load Conf from disk
|
||||||
Conf.load();
|
Conf.load();
|
||||||
FPlayers.i.loadFromDisc();
|
FPlayers.i.loadFromDisc();
|
||||||
@ -112,6 +113,7 @@ public class P extends MPlugin
|
|||||||
getServer().getPluginManager().registerEvents(serverListener, this);
|
getServer().getPluginManager().registerEvents(serverListener, this);
|
||||||
|
|
||||||
postEnable();
|
postEnable();
|
||||||
|
this.loadSuccessful = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -133,8 +135,12 @@ public class P extends MPlugin
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable()
|
public void onDisable()
|
||||||
{
|
{
|
||||||
Board.save();
|
// only save data if plugin actually completely loaded successfully
|
||||||
Conf.save();
|
if (this.loadSuccessful)
|
||||||
|
{
|
||||||
|
Board.save();
|
||||||
|
Conf.save();
|
||||||
|
}
|
||||||
EssentialsFeatures.unhookChat();
|
EssentialsFeatures.unhookChat();
|
||||||
if (AutoLeaveTask != null)
|
if (AutoLeaveTask != null)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,7 @@ public abstract class MPlugin extends JavaPlugin
|
|||||||
public Gson gson;
|
public Gson gson;
|
||||||
private Integer saveTask = null;
|
private Integer saveTask = null;
|
||||||
private boolean autoSave = true;
|
private boolean autoSave = true;
|
||||||
|
protected boolean loadSuccessful = false;
|
||||||
public boolean getAutoSave() {return this.autoSave;}
|
public boolean getAutoSave() {return this.autoSave;}
|
||||||
public void setAutoSave(boolean val) {this.autoSave = val;}
|
public void setAutoSave(boolean val) {this.autoSave = val;}
|
||||||
|
|
||||||
@ -81,7 +82,8 @@ public abstract class MPlugin extends JavaPlugin
|
|||||||
{
|
{
|
||||||
saveTask = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new SaveTask(this), saveTicks, saveTicks);
|
saveTask = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new SaveTask(this), saveTicks, saveTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadSuccessful = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +99,9 @@ public abstract class MPlugin extends JavaPlugin
|
|||||||
this.getServer().getScheduler().cancelTask(saveTask);
|
this.getServer().getScheduler().cancelTask(saveTask);
|
||||||
saveTask = null;
|
saveTask = null;
|
||||||
}
|
}
|
||||||
EM.saveAllToDisc();
|
// only save data if plugin actually loaded successfully
|
||||||
|
if (loadSuccessful)
|
||||||
|
EM.saveAllToDisc();
|
||||||
log("Disabled");
|
log("Disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user