diff --git a/pom.xml b/pom.xml
index 52e8a70..ad415a1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
cn.citycraft
ResExtras
- 1.0
+ 1.1
ResExtras
领地扩展
@@ -55,7 +55,7 @@
http://ci.citycraft.cn:8080
-
+ &c汉化提示条目 优化检测流程...
UTF-8
diff --git a/src/main/java/cn/citycraft/ResExtras/ResExtras.java b/src/main/java/cn/citycraft/ResExtras/ResExtras.java
index e33eba8..cfc7fe1 100644
--- a/src/main/java/cn/citycraft/ResExtras/ResExtras.java
+++ b/src/main/java/cn/citycraft/ResExtras/ResExtras.java
@@ -1,9 +1,9 @@
package cn.citycraft.ResExtras;
+import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@@ -12,92 +12,99 @@ import com.bekvon.bukkit.residence.protection.FlagPermissions;
import cn.citycraft.PluginHelper.config.FileConfig;
import cn.citycraft.PluginHelper.utils.VersionChecker;
-import cn.citycraft.ResExtras.flags.animalkilling;
-import cn.citycraft.ResExtras.flags.bat;
-import cn.citycraft.ResExtras.flags.blaze;
-import cn.citycraft.ResExtras.flags.blockdamage;
-import cn.citycraft.ResExtras.flags.cavespider;
-import cn.citycraft.ResExtras.flags.chicken;
-import cn.citycraft.ResExtras.flags.commands;
-import cn.citycraft.ResExtras.flags.cow;
-import cn.citycraft.ResExtras.flags.creeperspawn;
-import cn.citycraft.ResExtras.flags.drops;
-import cn.citycraft.ResExtras.flags.eggs;
-import cn.citycraft.ResExtras.flags.enderman;
-import cn.citycraft.ResExtras.flags.enderpearl;
-import cn.citycraft.ResExtras.flags.falldamage;
-import cn.citycraft.ResExtras.flags.fishing;
-import cn.citycraft.ResExtras.flags.form;
-import cn.citycraft.ResExtras.flags.ghast;
-import cn.citycraft.ResExtras.flags.god;
-import cn.citycraft.ResExtras.flags.grow;
-import cn.citycraft.ResExtras.flags.hunger;
-import cn.citycraft.ResExtras.flags.irongolem;
-import cn.citycraft.ResExtras.flags.lightning;
-import cn.citycraft.ResExtras.flags.magmacube;
-import cn.citycraft.ResExtras.flags.melt;
-import cn.citycraft.ResExtras.flags.mobkilling;
-import cn.citycraft.ResExtras.flags.mooshroom;
-import cn.citycraft.ResExtras.flags.ocelot;
-import cn.citycraft.ResExtras.flags.pickup;
-import cn.citycraft.ResExtras.flags.pig;
-import cn.citycraft.ResExtras.flags.pigsaddle;
-import cn.citycraft.ResExtras.flags.pigzap;
-import cn.citycraft.ResExtras.flags.portal;
-import cn.citycraft.ResExtras.flags.shear;
-import cn.citycraft.ResExtras.flags.sheep;
-import cn.citycraft.ResExtras.flags.silverfish;
-import cn.citycraft.ResExtras.flags.skeleton;
-import cn.citycraft.ResExtras.flags.slime;
-import cn.citycraft.ResExtras.flags.slimesplit;
-import cn.citycraft.ResExtras.flags.sneak;
-import cn.citycraft.ResExtras.flags.snowgolem;
-import cn.citycraft.ResExtras.flags.spider;
-import cn.citycraft.ResExtras.flags.sprint;
-import cn.citycraft.ResExtras.flags.squid;
-import cn.citycraft.ResExtras.flags.time;
-import cn.citycraft.ResExtras.flags.trade;
-import cn.citycraft.ResExtras.flags.vehicleprotect;
-import cn.citycraft.ResExtras.flags.villager;
-import cn.citycraft.ResExtras.flags.villagerkilling;
-import cn.citycraft.ResExtras.flags.weather;
-import cn.citycraft.ResExtras.flags.witch;
-import cn.citycraft.ResExtras.flags.witherspawn;
-import cn.citycraft.ResExtras.flags.wolf;
-import cn.citycraft.ResExtras.flags.zombie;
-import cn.citycraft.ResExtras.flags.zombiepigmen;
+import cn.citycraft.ResExtras.flags.Animalkilling;
+import cn.citycraft.ResExtras.flags.Bat;
+import cn.citycraft.ResExtras.flags.Blaze;
+import cn.citycraft.ResExtras.flags.BlockDamage;
+import cn.citycraft.ResExtras.flags.BlockForm;
+import cn.citycraft.ResExtras.flags.CaveSpider;
+import cn.citycraft.ResExtras.flags.Chicken;
+import cn.citycraft.ResExtras.flags.Commands;
+import cn.citycraft.ResExtras.flags.Cow;
+import cn.citycraft.ResExtras.flags.CreeperSpawn;
+import cn.citycraft.ResExtras.flags.DropItem;
+import cn.citycraft.ResExtras.flags.Eggs;
+import cn.citycraft.ResExtras.flags.EnderPearl;
+import cn.citycraft.ResExtras.flags.Enderman;
+import cn.citycraft.ResExtras.flags.FallDamage;
+import cn.citycraft.ResExtras.flags.Fishing;
+import cn.citycraft.ResExtras.flags.Ghast;
+import cn.citycraft.ResExtras.flags.God;
+import cn.citycraft.ResExtras.flags.Grow;
+import cn.citycraft.ResExtras.flags.Hunger;
+import cn.citycraft.ResExtras.flags.IronGolem;
+import cn.citycraft.ResExtras.flags.Lightning;
+import cn.citycraft.ResExtras.flags.MagmaCube;
+import cn.citycraft.ResExtras.flags.Melt;
+import cn.citycraft.ResExtras.flags.Mobkilling;
+import cn.citycraft.ResExtras.flags.Mooshroom;
+import cn.citycraft.ResExtras.flags.Ocelot;
+import cn.citycraft.ResExtras.flags.PickupItem;
+import cn.citycraft.ResExtras.flags.Pig;
+import cn.citycraft.ResExtras.flags.PiggySaddle;
+import cn.citycraft.ResExtras.flags.PiggyZap;
+import cn.citycraft.ResExtras.flags.Portal;
+import cn.citycraft.ResExtras.flags.Shear;
+import cn.citycraft.ResExtras.flags.Sheep;
+import cn.citycraft.ResExtras.flags.SilverFish;
+import cn.citycraft.ResExtras.flags.Skeleton;
+import cn.citycraft.ResExtras.flags.Slime;
+import cn.citycraft.ResExtras.flags.SlimeSplit;
+import cn.citycraft.ResExtras.flags.Sneak;
+import cn.citycraft.ResExtras.flags.SnowGolem;
+import cn.citycraft.ResExtras.flags.Spider;
+import cn.citycraft.ResExtras.flags.Sprint;
+import cn.citycraft.ResExtras.flags.Squid;
+import cn.citycraft.ResExtras.flags.Time;
+import cn.citycraft.ResExtras.flags.Trade;
+import cn.citycraft.ResExtras.flags.VehicleProtect;
+import cn.citycraft.ResExtras.flags.Villager;
+import cn.citycraft.ResExtras.flags.VillagerKilling;
+import cn.citycraft.ResExtras.flags.Weather;
+import cn.citycraft.ResExtras.flags.Witch;
+import cn.citycraft.ResExtras.flags.WitherSpawn;
+import cn.citycraft.ResExtras.flags.Wolf;
+import cn.citycraft.ResExtras.flags.Zombie;
+import cn.citycraft.ResExtras.flags.ZombiePigmen;
public class ResExtras extends JavaPlugin implements CommandExecutor {
- public FileConfig config;
+ public static FileConfig config;
+ public static String pluginname;
+
+ public static void sendMessage(final CommandSender sender, final String path) {
+ sender.sendMessage(pluginname + config.getMessage("§cMessage." + path));
+ }
@Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
- if (sender instanceof Player) {
- if (args.length == 0) {
- sendHelp(sender);
- }
- if (args.length == 1) {
- switch (args[0].toLowerCase()) {
- case "version":
- if (sender.hasPermission("ResExtras.version")) {
- sender.sendMessage("§6[§bResExtras§6] §av2.0.5 §6重制 §dBy §a喵♂呜");
- }
- return true;
- case "list":
- if (sender.hasPermission("ResExtras.list")) {
- sender.sendMessage("§6[§bResExtras§6] §a 扩展Flags");
- sender.sendMessage("Zombie, Skeleton, Spider, Creeperspawn, Blaze, Cavespider, Ghast, Slime, Magmacube, Silverfish, Snowgolem, Irongolem, Enderman, Zombiepigmen, "
- + "Chicken, Cow, Mooshroom, Ocelot, Pig, Sheep, Squid, Villager, Wolf, Bat, Witherspawn, Witch, Form, Melt, Commands, FallDamage, Portal, Enderperal, "
- + "Mobkilling, AnimalKilling, VillagerKilling, Drops, Pickup, VehicleProtect, Lightning, Grow, Hunger, Sprint, Fishing, Eggs, Sneak, PigZap, SlimeSplit, "
- + "Shear, PigSaddle, Trade, God, Weather, Time, BlockDamage ");
- }
- return true;
- case "help":
- sendHelp(sender);
- return true;
+ if (args.length == 1) {
+ switch (args[0].toLowerCase()) {
+ case "version":
+ if (sender.hasPermission("ResExtras.version")) {
+ sender.sendMessage(pluginname + " §av" + this.getDescription().getVersion() + " §6重制 §dBy §a喵♂呜");
}
+ return true;
+ case "list":
+ if (sender.hasPermission("ResExtras.list")) {
+ sender.sendMessage(pluginname + " §a 扩展Flags");
+ sender.sendMessage("Zombie, Skeleton, Spider, Creeperspawn, Blaze, Cavespider, Ghast, Slime, Magmacube, Silverfish, Snowgolem, Irongolem, Enderman, Zombiepigmen, "
+ + "Chicken, Cow, Mooshroom, Ocelot, Pig, Sheep, Squid, Villager, Wolf, Bat, Witherspawn, Witch, Form, Melt, Commands, FallDamage, Portal, Enderperal, "
+ + "Mobkilling, AnimalKilling, VillagerKilling, Drops, Pickup, VehicleProtect, Lightning, Grow, Hunger, Sprint, Fishing, Eggs, Sneak, PigZap, SlimeSplit, "
+ + "Shear, PigSaddle, Trade, God, Weather, Time, BlockDamage ");
+ }
+ return true;
+ case "reload":
+ if (sender.hasPermission("ResExtras.reload")) {
+ final PluginManager pm = Bukkit.getPluginManager();
+ pm.disablePlugin(this);
+ onLoad();
+ pm.enablePlugin(this);
+ sender.sendMessage(pluginname + "§a配置文件已重载!");
+ }
+ return true;
}
}
+ sendHelp(sender);
return true;
}
@@ -163,167 +170,167 @@ public class ResExtras extends JavaPlugin implements CommandExecutor {
FlagPermissions.addResidenceOnlyFlag("day");
FlagPermissions.addResidenceOnlyFlag("night");
FlagPermissions.addResidenceOnlyFlag("blockdamage");
- if (getConfig().getBoolean("Zombie", true)) {
- pm.registerEvents(new zombie(), this);
+ if (getConfig().getBoolean("Flags.Zombie", true)) {
+ pm.registerEvents(new Zombie(), this);
}
- if (getConfig().getBoolean("Skeleton", true)) {
- pm.registerEvents(new skeleton(), this);
+ if (getConfig().getBoolean("Flags.Skeleton", true)) {
+ pm.registerEvents(new Skeleton(), this);
}
- if (getConfig().getBoolean("Creeperspawn", true)) {
- pm.registerEvents(new creeperspawn(), this);
+ if (getConfig().getBoolean("Flags.Creeperspawn", true)) {
+ pm.registerEvents(new CreeperSpawn(), this);
}
- if (getConfig().getBoolean("Spider", true)) {
- pm.registerEvents(new spider(), this);
+ if (getConfig().getBoolean("Flags.Spider", true)) {
+ pm.registerEvents(new Spider(), this);
}
- if (getConfig().getBoolean("Cavespider", true)) {
- pm.registerEvents(new cavespider(), this);
+ if (getConfig().getBoolean("Flags.Cavespider", true)) {
+ pm.registerEvents(new CaveSpider(), this);
}
- if (getConfig().getBoolean("Slime", true)) {
- pm.registerEvents(new slime(), this);
+ if (getConfig().getBoolean("Flags.Slime", true)) {
+ pm.registerEvents(new Slime(), this);
}
- if (getConfig().getBoolean("Ghast", true)) {
- pm.registerEvents(new ghast(), this);
+ if (getConfig().getBoolean("Flags.Ghast", true)) {
+ pm.registerEvents(new Ghast(), this);
}
- if (getConfig().getBoolean("Blaze", true)) {
- pm.registerEvents(new blaze(), this);
+ if (getConfig().getBoolean("Flags.Blaze", true)) {
+ pm.registerEvents(new Blaze(), this);
}
- if (getConfig().getBoolean("Magmacube", true)) {
- pm.registerEvents(new magmacube(), this);
+ if (getConfig().getBoolean("Flags.Magmacube", true)) {
+ pm.registerEvents(new MagmaCube(), this);
}
- if (getConfig().getBoolean("Silverfish", true)) {
- pm.registerEvents(new silverfish(), this);
+ if (getConfig().getBoolean("Flags.Silverfish", true)) {
+ pm.registerEvents(new SilverFish(), this);
}
- if (getConfig().getBoolean("Snowgolem", true)) {
- pm.registerEvents(new snowgolem(), this);
+ if (getConfig().getBoolean("Flags.Snowgolem", true)) {
+ pm.registerEvents(new SnowGolem(), this);
}
- if (getConfig().getBoolean("Irongolem", true)) {
- pm.registerEvents(new irongolem(), this);
+ if (getConfig().getBoolean("Flags.Irongolem", true)) {
+ pm.registerEvents(new IronGolem(), this);
}
- if (getConfig().getBoolean("Enderman", true)) {
- pm.registerEvents(new enderman(), this);
+ if (getConfig().getBoolean("Flags.Enderman", true)) {
+ pm.registerEvents(new Enderman(), this);
}
- if (getConfig().getBoolean("Chicken", true)) {
- pm.registerEvents(new chicken(), this);
+ if (getConfig().getBoolean("Flags.Chicken", true)) {
+ pm.registerEvents(new Chicken(), this);
}
- if (getConfig().getBoolean("Cow", true)) {
- pm.registerEvents(new cow(), this);
+ if (getConfig().getBoolean("Flags.Cow", true)) {
+ pm.registerEvents(new Cow(), this);
}
- if (getConfig().getBoolean("Wolf", true)) {
- pm.registerEvents(new wolf(), this);
+ if (getConfig().getBoolean("Flags.Wolf", true)) {
+ pm.registerEvents(new Wolf(), this);
}
- if (getConfig().getBoolean("Mooshroom", true)) {
- pm.registerEvents(new mooshroom(), this);
+ if (getConfig().getBoolean("Flags.Mooshroom", true)) {
+ pm.registerEvents(new Mooshroom(), this);
}
- if (getConfig().getBoolean("Ocelot", true)) {
- pm.registerEvents(new ocelot(), this);
+ if (getConfig().getBoolean("Flags.Ocelot", true)) {
+ pm.registerEvents(new Ocelot(), this);
}
- if (getConfig().getBoolean("Zombiepigmen", true)) {
- pm.registerEvents(new zombiepigmen(), this);
+ if (getConfig().getBoolean("Flags.Zombiepigmen", true)) {
+ pm.registerEvents(new ZombiePigmen(), this);
}
- if (getConfig().getBoolean("Pig", true)) {
- pm.registerEvents(new pig(), this);
+ if (getConfig().getBoolean("Flags.Pig", true)) {
+ pm.registerEvents(new Pig(), this);
}
- if (getConfig().getBoolean("Sheep", true)) {
- pm.registerEvents(new sheep(), this);
+ if (getConfig().getBoolean("Flags.Sheep", true)) {
+ pm.registerEvents(new Sheep(), this);
}
- if (getConfig().getBoolean("Squid", true)) {
- pm.registerEvents(new squid(), this);
+ if (getConfig().getBoolean("Flags.Squid", true)) {
+ pm.registerEvents(new Squid(), this);
}
- if (getConfig().getBoolean("Villager", true)) {
- pm.registerEvents(new villager(), this);
+ if (getConfig().getBoolean("Flags.Villager", true)) {
+ pm.registerEvents(new Villager(), this);
}
- if (getConfig().getBoolean("Bat", true)) {
- pm.registerEvents(new bat(), this);
+ if (getConfig().getBoolean("Flags.Bat", true)) {
+ pm.registerEvents(new Bat(), this);
}
- if (getConfig().getBoolean("Witch", true)) {
- pm.registerEvents(new witch(), this);
+ if (getConfig().getBoolean("Flags.Witch", true)) {
+ pm.registerEvents(new Witch(), this);
}
- if (getConfig().getBoolean("Witherspawn", true)) {
- pm.registerEvents(new witherspawn(), this);
+ if (getConfig().getBoolean("Flags.Witherspawn", true)) {
+ pm.registerEvents(new WitherSpawn(), this);
}
- if (getConfig().getBoolean("Melt", true)) {
- pm.registerEvents(new melt(), this);
+ if (getConfig().getBoolean("Flags.Melt", true)) {
+ pm.registerEvents(new Melt(), this);
}
- if (getConfig().getBoolean("Form", true)) {
- pm.registerEvents(new form(), this);
+ if (getConfig().getBoolean("Flags.Form", true)) {
+ pm.registerEvents(new BlockForm(), this);
}
- if (getConfig().getBoolean("Animalkilling", true)) {
- pm.registerEvents(new animalkilling(), this);
+ if (getConfig().getBoolean("Flags.Animalkilling", true)) {
+ pm.registerEvents(new Animalkilling(), this);
}
- if (getConfig().getBoolean("Mobkilling", true)) {
- pm.registerEvents(new mobkilling(), this);
+ if (getConfig().getBoolean("Flags.Mobkilling", true)) {
+ pm.registerEvents(new Mobkilling(), this);
}
- if (getConfig().getBoolean("Drops", true)) {
- pm.registerEvents(new drops(), this);
+ if (getConfig().getBoolean("Flags.DropItem", true)) {
+ pm.registerEvents(new DropItem(), this);
}
- if (getConfig().getBoolean("Pickup", true)) {
- pm.registerEvents(new pickup(), this);
+ if (getConfig().getBoolean("Flags.Pickup", true)) {
+ pm.registerEvents(new PickupItem(), this);
}
- if (getConfig().getBoolean("Commands", true)) {
- pm.registerEvents(new commands(), this);
+ if (getConfig().getBoolean("Flags.Commands", true)) {
+ pm.registerEvents(new Commands(), this);
}
- if (getConfig().getBoolean("Enderpearl", true)) {
- pm.registerEvents(new enderpearl(), this);
+ if (getConfig().getBoolean("Flags.Enderpearl", true)) {
+ pm.registerEvents(new EnderPearl(), this);
}
- if (getConfig().getBoolean("Falldamage", true)) {
- pm.registerEvents(new falldamage(), this);
+ if (getConfig().getBoolean("Flags.Falldamage", true)) {
+ pm.registerEvents(new FallDamage(), this);
}
- if (getConfig().getBoolean("Portal", true)) {
- pm.registerEvents(new portal(), this);
+ if (getConfig().getBoolean("Flags.Portal", true)) {
+ pm.registerEvents(new Portal(), this);
}
- if (getConfig().getBoolean("Villagerkilling", true)) {
- pm.registerEvents(new villagerkilling(), this);
+ if (getConfig().getBoolean("Flags.Villagerkilling", true)) {
+ pm.registerEvents(new VillagerKilling(), this);
}
- if (getConfig().getBoolean("Vehicleprotect", true)) {
- pm.registerEvents(new vehicleprotect(), this);
+ if (getConfig().getBoolean("Flags.Vehicleprotect", true)) {
+ pm.registerEvents(new VehicleProtect(), this);
}
- if (getConfig().getBoolean("Lightning", true)) {
- pm.registerEvents(new lightning(), this);
+ if (getConfig().getBoolean("Flags.Lightning", true)) {
+ pm.registerEvents(new Lightning(), this);
}
- if (getConfig().getBoolean("Grow", true)) {
- pm.registerEvents(new grow(), this);
+ if (getConfig().getBoolean("Flags.Grow", true)) {
+ pm.registerEvents(new Grow(), this);
}
- if (getConfig().getBoolean("Hunger", true)) {
- pm.registerEvents(new hunger(), this);
+ if (getConfig().getBoolean("Flags.Hunger", true)) {
+ pm.registerEvents(new Hunger(), this);
}
- if (getConfig().getBoolean("Sprint", true)) {
- pm.registerEvents(new sprint(), this);
+ if (getConfig().getBoolean("Flags.Sprint", true)) {
+ pm.registerEvents(new Sprint(), this);
}
- if (getConfig().getBoolean("Fishing", true)) {
- pm.registerEvents(new fishing(), this);
+ if (getConfig().getBoolean("Flags.Fishing", true)) {
+ pm.registerEvents(new Fishing(), this);
}
- if (getConfig().getBoolean("Eggs", true)) {
- pm.registerEvents(new eggs(), this);
+ if (getConfig().getBoolean("Flags.Eggs", true)) {
+ pm.registerEvents(new Eggs(), this);
}
- if (getConfig().getBoolean("Sneak", true)) {
- pm.registerEvents(new sneak(), this);
+ if (getConfig().getBoolean("Flags.Sneak", true)) {
+ pm.registerEvents(new Sneak(), this);
}
- if (getConfig().getBoolean("Pigzap", true)) {
- pm.registerEvents(new pigzap(), this);
+ if (getConfig().getBoolean("Flags.Pigzap", true)) {
+ pm.registerEvents(new PiggyZap(), this);
}
- if (getConfig().getBoolean("Slimesplit", true)) {
- pm.registerEvents(new slimesplit(), this);
+ if (getConfig().getBoolean("Flags.Slimesplit", true)) {
+ pm.registerEvents(new SlimeSplit(), this);
}
- if (getConfig().getBoolean("Shear", true)) {
- pm.registerEvents(new shear(), this);
+ if (getConfig().getBoolean("Flags.Shear", true)) {
+ pm.registerEvents(new Shear(), this);
}
- if (getConfig().getBoolean("Pigsaddle", true)) {
- pm.registerEvents(new pigsaddle(), this);
+ if (getConfig().getBoolean("Flags.Pigsaddle", true)) {
+ pm.registerEvents(new PiggySaddle(), this);
}
- if (getConfig().getBoolean("Trade", true)) {
- pm.registerEvents(new trade(), this);
+ if (getConfig().getBoolean("Flags.Trade", true)) {
+ pm.registerEvents(new Trade(), this);
}
- if (getConfig().getBoolean("God", true)) {
- pm.registerEvents(new god(), this);
+ if (getConfig().getBoolean("Flags.God", true)) {
+ pm.registerEvents(new God(), this);
}
- if (getConfig().getBoolean("Weather", true)) {
- pm.registerEvents(new weather(), this);
+ if (getConfig().getBoolean("Flags.Weather", true)) {
+ pm.registerEvents(new Weather(), this);
}
- if (getConfig().getBoolean("Time", true)) {
- pm.registerEvents(new time(), this);
+ if (getConfig().getBoolean("Flags.Time", true)) {
+ pm.registerEvents(new Time(), this);
}
- if (getConfig().getBoolean("BlockDamage", true)) {
- pm.registerEvents(new blockdamage(), this);
+ if (getConfig().getBoolean("Flags.BlockDamage", true)) {
+ pm.registerEvents(new BlockDamage(), this);
}
this.getLogger().info("领地扩展 版本 " + this.getDescription().getVersion() + " 已正确载入 重置 By 喵♂呜");
new VersionChecker(this);
@@ -337,12 +344,14 @@ public class ResExtras extends JavaPlugin implements CommandExecutor {
@Override
public void onLoad() {
config = new FileConfig(this);
+ pluginname = config.getMessage("pluginname");
}
public void sendHelp(final CommandSender sender) {
sender.sendMessage("§6========= §6[§b领地扩展§6] §6插件帮助列表=========");
- sender.sendMessage("§6/ResExtras help §6- §a显示帮助页面");
sender.sendMessage("§6/ResExtras version §6- §a显示插件版本");
sender.sendMessage("§6/ResExtras list §6- §a显示Flags列表");
+ sender.sendMessage("§6/ResExtras reload §6- §a重载插件");
+ sender.sendMessage("§6/ResExtras help §6- §a显示帮助页面");
}
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/animalkilling.java b/src/main/java/cn/citycraft/ResExtras/flags/Animalkilling.java
similarity index 68%
rename from src/main/java/cn/citycraft/ResExtras/flags/animalkilling.java
rename to src/main/java/cn/citycraft/ResExtras/flags/Animalkilling.java
index a45e32a..5ea6f4e 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/animalkilling.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Animalkilling.java
@@ -1,6 +1,5 @@
package cn.citycraft.ResExtras.flags;
-import org.bukkit.ChatColor;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
@@ -15,14 +14,13 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-public class animalkilling implements Listener {
- public Player cause;
+import cn.citycraft.ResExtras.ResExtras;
- @EventHandler(priority = EventPriority.NORMAL)
+public class Animalkilling implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void AnimalKilling(final EntityDamageByEntityEvent event) {
- if (event.isCancelled()) {
- return;
- }
+ Player p;
final Entity damager = event.getDamager();
if ((!(damager instanceof Arrow)) && (!(damager instanceof Player))) {
return;
@@ -30,20 +28,20 @@ public class animalkilling implements Listener {
if ((damager instanceof Arrow) && (!(((Arrow) damager).getShooter() instanceof Player))) {
return;
} else if (damager instanceof Player) {
- cause = (Player) damager;
+ p = (Player) damager;
} else {
- cause = (Player) ((Arrow) damager).getShooter();
+ p = (Player) ((Arrow) damager).getShooter();
}
- final boolean resadmin = Residence.isResAdminOn(cause);
+ final boolean resadmin = Residence.isResAdminOn(p);
if (resadmin) {
return;
}
final Entity entity = event.getEntity();
final ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
- if (res != null && !res.getPermissions().playerHas(cause.getName().toString(), "animalkilling", true)) {
+ if (res != null && !res.getPermissions().playerHas(p.getName().toString(), "animalkilling", true)) {
if ((entity instanceof Animals) || (entity instanceof IronGolem) || (entity instanceof Snowman)) {
- cause.sendMessage(ChatColor.RED + "You cannot kill animals here!");
+ ResExtras.sendMessage(p, "Animalkilling");
event.setCancelled(true);
}
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Bat.java b/src/main/java/cn/citycraft/ResExtras/flags/Bat.java
new file mode 100644
index 0000000..41f42a2
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Bat.java
@@ -0,0 +1,24 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Bat implements Listener {
+ @EventHandler
+ public void onBat(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Bat) {
+ if (FlagPermissions.has("bat", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Blaze.java b/src/main/java/cn/citycraft/ResExtras/flags/Blaze.java
new file mode 100644
index 0000000..d377cab
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Blaze.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Blaze implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onBlaze(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Blaze) {
+ if (FlagPermissions.has("blaze", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/BlockDamage.java b/src/main/java/cn/citycraft/ResExtras/flags/BlockDamage.java
new file mode 100644
index 0000000..b034ca5
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/BlockDamage.java
@@ -0,0 +1,21 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityExplodeEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class BlockDamage implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onBlockDamage(final EntityExplodeEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("blockdamage", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/BlockForm.java b/src/main/java/cn/citycraft/ResExtras/flags/BlockForm.java
new file mode 100644
index 0000000..36a3b1e
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/BlockForm.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.block.BlockFormEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class BlockForm implements Listener {
+ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
+ public void onBlockForm(final BlockFormEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("form", true)) {
+ event.setCancelled(true);
+ }
+ } else {
+ if (!Residence.getWorldFlags().getPerms(event.getBlock().getWorld().getName()).has("form", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/CaveSpider.java b/src/main/java/cn/citycraft/ResExtras/flags/CaveSpider.java
new file mode 100644
index 0000000..85f0d4d
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/CaveSpider.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class CaveSpider implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onCaveSpider(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.CaveSpider) {
+ if (FlagPermissions.has("cavespider", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Chicken.java b/src/main/java/cn/citycraft/ResExtras/flags/Chicken.java
new file mode 100644
index 0000000..bc81a31
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Chicken.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Chicken implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onChicken(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Chicken) {
+ if (FlagPermissions.has("chicken", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Commands.java b/src/main/java/cn/citycraft/ResExtras/flags/Commands.java
new file mode 100644
index 0000000..63286fb
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Commands.java
@@ -0,0 +1,28 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerCommandPreprocessEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Commands implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onCommands(final PlayerCommandPreprocessEvent event) {
+ final Player player = event.getPlayer();
+ final Location loc = event.getPlayer().getLocation();
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
+ final String playername = player.getName();
+ if (res != null && !res.getPermissions().playerHas(playername, "commands", true) && !resadmin) {
+ event.setCancelled(true);
+ ResExtras.sendMessage(event.getPlayer(), "Commands");
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Cow.java b/src/main/java/cn/citycraft/ResExtras/flags/Cow.java
new file mode 100644
index 0000000..d785499
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Cow.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Cow implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onCow(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Cow) {
+ if (FlagPermissions.has("cow", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/CreeperSpawn.java b/src/main/java/cn/citycraft/ResExtras/flags/CreeperSpawn.java
new file mode 100644
index 0000000..a1e3ff8
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/CreeperSpawn.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.Creeper;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class CreeperSpawn implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onCreeperSpawn(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof Creeper) {
+ if (FlagPermissions.has("creeperspawn", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/DropItem.java b/src/main/java/cn/citycraft/ResExtras/flags/DropItem.java
new file mode 100644
index 0000000..f7e2da0
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/DropItem.java
@@ -0,0 +1,31 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerDropItemEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class DropItem implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onDrops(final PlayerDropItemEvent event) {
+ final Player player = event.getPlayer();
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getItemDrop().getLocation());
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "drops", true) && !resadmin) {
+ event.setCancelled(true);
+ ResExtras.sendMessage(player, "DropItem");
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Eggs.java b/src/main/java/cn/citycraft/ResExtras/flags/Eggs.java
new file mode 100644
index 0000000..8bdf8a2
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Eggs.java
@@ -0,0 +1,31 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerEggThrowEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Eggs implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onEggs(final PlayerEggThrowEvent event) {
+ final Player player = event.getPlayer();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "eggs", true) && !resadmin) {
+ event.setHatching(false);
+ ResExtras.sendMessage(player, "Eggs");
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/EnderPearl.java b/src/main/java/cn/citycraft/ResExtras/flags/EnderPearl.java
new file mode 100644
index 0000000..755a122
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/EnderPearl.java
@@ -0,0 +1,34 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerTeleportEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class EnderPearl implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onEnderPearl(final PlayerTeleportEvent event) {
+ final Location loc = event.getTo();
+ final Player player = event.getPlayer();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (event.getCause() == TeleportCause.ENDER_PEARL && !res.getPermissions().playerHas(playername, "enderpearl", true) && !resadmin) {
+ event.setCancelled(true);
+ ResExtras.sendMessage(player, "EnderPearl");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Enderman.java b/src/main/java/cn/citycraft/ResExtras/flags/Enderman.java
new file mode 100644
index 0000000..f0ed55a
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Enderman.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Enderman implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onEnderman(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Enderman) {
+ if (FlagPermissions.has("enderman", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/FallDamage.java b/src/main/java/cn/citycraft/ResExtras/flags/FallDamage.java
new file mode 100644
index 0000000..b31d86e
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/FallDamage.java
@@ -0,0 +1,27 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class FallDamage implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onFallDamage(final EntityDamageEvent event) {
+ final Entity entity = event.getEntity();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
+ if (event.getCause() == DamageCause.FALL && event.getEntity() instanceof Player) {
+ if (res != null) {
+ if (!res.getPermissions().has("falldamage", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Fishing.java b/src/main/java/cn/citycraft/ResExtras/flags/Fishing.java
new file mode 100644
index 0000000..c074f86
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Fishing.java
@@ -0,0 +1,31 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerFishEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Fishing implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onFishing(final PlayerFishEvent event) {
+ final Player player = event.getPlayer();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "fishing", true) && !resadmin) {
+ ResExtras.sendMessage(player, "Fishing");
+ event.setCancelled(true);
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Ghast.java b/src/main/java/cn/citycraft/ResExtras/flags/Ghast.java
new file mode 100644
index 0000000..4547386
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Ghast.java
@@ -0,0 +1,24 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Ghast implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onGhast(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Ghast) {
+ if (!FlagPermissions.has("ghast", true))
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/God.java b/src/main/java/cn/citycraft/ResExtras/flags/God.java
new file mode 100644
index 0000000..2627034
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/God.java
@@ -0,0 +1,38 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.Effect;
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class God implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onGod(final EntityDamageEvent event) {
+ try {
+ final Entity entity = event.getEntity();
+ final Player player = ((Player) event.getEntity());
+ final World world = player.getWorld();
+ final String playername = player.getName();
+ final Location location = player.getLocation();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
+ if (event.getEntity() instanceof Player) {
+ if (res != null) {
+ if (res.getPermissions().playerHas(playername, "god", false)) {
+ world.playEffect(location, Effect.MOBSPAWNER_FLAMES, 4);
+ event.setCancelled(true);
+ }
+ }
+ }
+ } catch (final Exception ex) {
+
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Grow.java b/src/main/java/cn/citycraft/ResExtras/flags/Grow.java
new file mode 100644
index 0000000..f018e0c
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Grow.java
@@ -0,0 +1,46 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.block.BlockGrowEvent;
+import org.bukkit.event.block.BlockSpreadEvent;
+import org.bukkit.event.world.StructureGrowEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class Grow implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void BlockGrow(final BlockGrowEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("grow", true)) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void BlockGrowSpread(final BlockSpreadEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("grow", true)) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void StructureGrow(final StructureGrowEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("grow", true)) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Hunger.java b/src/main/java/cn/citycraft/ResExtras/flags/Hunger.java
new file mode 100644
index 0000000..2db717e
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Hunger.java
@@ -0,0 +1,22 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.FoodLevelChangeEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class Hunger implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onHunger(final FoodLevelChangeEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("hunger", true)) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/IronGolem.java b/src/main/java/cn/citycraft/ResExtras/flags/IronGolem.java
new file mode 100644
index 0000000..4a1fff6
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/IronGolem.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class IronGolem implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onIronGolem(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.IronGolem) {
+ if (FlagPermissions.has("irongolem", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Lightning.java b/src/main/java/cn/citycraft/ResExtras/flags/Lightning.java
new file mode 100644
index 0000000..e4b1502
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Lightning.java
@@ -0,0 +1,22 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.weather.LightningStrikeEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class Lightning implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onLightning(final LightningStrikeEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLightning().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("lightning", true)) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/MagmaCube.java b/src/main/java/cn/citycraft/ResExtras/flags/MagmaCube.java
new file mode 100644
index 0000000..1cdb0da
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/MagmaCube.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class MagmaCube implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onMagmaCube(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.MagmaCube) {
+ if (FlagPermissions.has("magmacube", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Melt.java b/src/main/java/cn/citycraft/ResExtras/flags/Melt.java
new file mode 100644
index 0000000..126a527
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Melt.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.block.BlockFadeEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class Melt implements Listener {
+ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
+ public void onMelt(final BlockFadeEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("melt", true)) {
+ event.setCancelled(true);
+ }
+ } else {
+ if (!Residence.getWorldFlags().getPerms(event.getBlock().getWorld().getName()).has("melt", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/mobkilling.java b/src/main/java/cn/citycraft/ResExtras/flags/Mobkilling.java
similarity index 77%
rename from src/main/java/cn/citycraft/ResExtras/flags/mobkilling.java
rename to src/main/java/cn/citycraft/ResExtras/flags/Mobkilling.java
index 62f3b7d..e5beb4a 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/mobkilling.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Mobkilling.java
@@ -1,6 +1,5 @@
package cn.citycraft.ResExtras.flags;
-import org.bukkit.ChatColor;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Monster;
@@ -13,14 +12,13 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-public class mobkilling implements Listener {
- public Player cause;
+import cn.citycraft.ResExtras.ResExtras;
- @EventHandler(priority = EventPriority.NORMAL)
- public void Mobkilling(final EntityDamageByEntityEvent event) {
- if (event.isCancelled()) {
- return;
- }
+public class Mobkilling implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onMobkilling(final EntityDamageByEntityEvent event) {
+ Player cause;
final Entity damager = event.getDamager();
if ((!(damager instanceof Arrow)) && (!(damager instanceof Player))) {
return;
@@ -41,7 +39,7 @@ public class mobkilling implements Listener {
if (res != null && !res.getPermissions().playerHas(cause.getName().toString(), "mobkilling", true)) {
if (entity instanceof Monster) {
- cause.sendMessage(ChatColor.RED + "You cannot kill mobs here!");
+ ResExtras.sendMessage(cause, "Mobkilling");
event.setCancelled(true);
}
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Mooshroom.java b/src/main/java/cn/citycraft/ResExtras/flags/Mooshroom.java
new file mode 100644
index 0000000..54fdd44
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Mooshroom.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.MushroomCow;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Mooshroom implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onMooshroom(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof MushroomCow) {
+ if (FlagPermissions.has("mooshroom", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Ocelot.java b/src/main/java/cn/citycraft/ResExtras/flags/Ocelot.java
new file mode 100644
index 0000000..a8add00
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Ocelot.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Ocelot implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onOcelot(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Ocelot) {
+ if (FlagPermissions.has("ocelot", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/PickupItem.java b/src/main/java/cn/citycraft/ResExtras/flags/PickupItem.java
new file mode 100644
index 0000000..bc266e9
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/PickupItem.java
@@ -0,0 +1,31 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerPickupItemEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class PickupItem implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPickupItem(final PlayerPickupItemEvent event) {
+ final Player player = event.getPlayer();
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getItem().getLocation());
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "pickup", true) && !resadmin) {
+ ResExtras.sendMessage(player, "PickupItem");
+ event.setCancelled(true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Pig.java b/src/main/java/cn/citycraft/ResExtras/flags/Pig.java
new file mode 100644
index 0000000..db5509c
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Pig.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Pig implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPig(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Pig) {
+ if (FlagPermissions.has("pig", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/PiggySaddle.java b/src/main/java/cn/citycraft/ResExtras/flags/PiggySaddle.java
new file mode 100644
index 0000000..f287c08
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/PiggySaddle.java
@@ -0,0 +1,36 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerInteractEntityEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class PiggySaddle implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPiggySaddle(final PlayerInteractEntityEvent event) {
+ final Entity pig = event.getRightClicked();
+ final Player player = event.getPlayer();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "pigsaddle", true) && !resadmin) {
+ if (pig.getType() == EntityType.PIG) {
+ ResExtras.sendMessage(player, "PiggySaddle");
+ event.setCancelled(true);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/PiggyZap.java b/src/main/java/cn/citycraft/ResExtras/flags/PiggyZap.java
new file mode 100644
index 0000000..16bbc92
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/PiggyZap.java
@@ -0,0 +1,22 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.PigZapEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class PiggyZap implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPiggyZap(final PigZapEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("pigzap", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Portal.java b/src/main/java/cn/citycraft/ResExtras/flags/Portal.java
new file mode 100644
index 0000000..ef79b7f
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Portal.java
@@ -0,0 +1,33 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerPortalEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Portal implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPortal(final PlayerPortalEvent event) {
+ final Player player = event.getPlayer();
+ final Location loc = event.getPlayer().getLocation();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "portal", true) && !resadmin) {
+ ResExtras.sendMessage(player, "Pearl");
+ event.setCancelled(true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Shear.java b/src/main/java/cn/citycraft/ResExtras/flags/Shear.java
new file mode 100644
index 0000000..c7a54e6
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Shear.java
@@ -0,0 +1,29 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerShearEntityEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Shear implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onShear(final PlayerShearEntityEvent event) {
+ final Player player = event.getPlayer();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null && !res.getPermissions().playerHas(playername, "shear", true) && !resadmin) {
+ ResExtras.sendMessage(player, "Shear");
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Sheep.java b/src/main/java/cn/citycraft/ResExtras/flags/Sheep.java
new file mode 100644
index 0000000..097c5f8
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Sheep.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Sheep implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSheep(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Sheep) {
+ if (FlagPermissions.has("sheep", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/SilverFish.java b/src/main/java/cn/citycraft/ResExtras/flags/SilverFish.java
new file mode 100644
index 0000000..3d146dc
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/SilverFish.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class SilverFish implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSilverFish(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Silverfish) {
+ if (FlagPermissions.has("silverfish", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Skeleton.java b/src/main/java/cn/citycraft/ResExtras/flags/Skeleton.java
new file mode 100644
index 0000000..af5b93c
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Skeleton.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Skeleton implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSkeleton(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Skeleton) {
+ if (FlagPermissions.has("skeleton", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Slime.java b/src/main/java/cn/citycraft/ResExtras/flags/Slime.java
new file mode 100644
index 0000000..a834979
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Slime.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Slime implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSlime(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Slime) {
+ if (FlagPermissions.has("slime", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/SlimeSplit.java b/src/main/java/cn/citycraft/ResExtras/flags/SlimeSplit.java
new file mode 100644
index 0000000..1f9a470
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/SlimeSplit.java
@@ -0,0 +1,21 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.SlimeSplitEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+public class SlimeSplit implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSlimeSplit(final SlimeSplitEvent event) {
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().has("slimesplit", true)) {
+ event.setCancelled(true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Sneak.java b/src/main/java/cn/citycraft/ResExtras/flags/Sneak.java
new file mode 100644
index 0000000..f325b18
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Sneak.java
@@ -0,0 +1,38 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerMoveEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Sneak implements Listener {
+
+ @EventHandler(priority = EventPriority.MONITOR)
+ public void onSneak(final PlayerMoveEvent event) {
+ final Player player = event.getPlayer();
+ if (!player.isSprinting() && (!player.isSneaking()))
+ return;
+ final boolean resadmin = Residence.isResAdminOn(player);
+ if (resadmin) {
+ return;
+ }
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ final String playername = player.getName();
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "sneak", true) && player.isSneaking()) {
+ event.setCancelled(true);
+ final long currentTime = System.currentTimeMillis();
+ if (currentTime % 2000 >= 0 && currentTime % 2000 <= 100) {
+ ResExtras.sendMessage(player, "Sneak");
+ return;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/SnowGolem.java b/src/main/java/cn/citycraft/ResExtras/flags/SnowGolem.java
new file mode 100644
index 0000000..4050ec2
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/SnowGolem.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class SnowGolem implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSnowGolem(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Snowman) {
+ if (FlagPermissions.has("snowgolem", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Spider.java b/src/main/java/cn/citycraft/ResExtras/flags/Spider.java
new file mode 100644
index 0000000..d409683
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Spider.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Spider implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSpider(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Spider) {
+ if (FlagPermissions.has("spider", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Sprint.java b/src/main/java/cn/citycraft/ResExtras/flags/Sprint.java
new file mode 100644
index 0000000..ccc0d32
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Sprint.java
@@ -0,0 +1,40 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerMoveEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Sprint implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.MONITOR)
+ public void onSprint(final PlayerMoveEvent event) {
+ final Player player = event.getPlayer();
+ final String playername = player.getName();
+ final boolean resadmin = Residence.isResAdminOn(player);
+ if (resadmin) {
+ return;
+ }
+ if (!player.isSprinting() && (!player.isSneaking()))
+ return;
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
+ if (res != null) {
+ if (!res.getPermissions().playerHas(playername, "sprint", true) && player.isSprinting()) {
+ event.setCancelled(true);
+ final long currentTime = System.currentTimeMillis();
+ if (currentTime % 2000 >= 0 && currentTime % 2000 <= 100) {
+ ResExtras.sendMessage(player, "Sprint");
+ return;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Squid.java b/src/main/java/cn/citycraft/ResExtras/flags/Squid.java
new file mode 100644
index 0000000..7544579
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Squid.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Squid implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onSquid(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Squid) {
+ if (FlagPermissions.has("squid", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/time.java b/src/main/java/cn/citycraft/ResExtras/flags/Time.java
similarity index 59%
rename from src/main/java/cn/citycraft/ResExtras/flags/time.java
rename to src/main/java/cn/citycraft/ResExtras/flags/Time.java
index 719a62f..fa06a39 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/time.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Time.java
@@ -2,16 +2,37 @@ package cn.citycraft.ResExtras.flags;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
+import com.bekvon.bukkit.residence.event.ResidenceChangedEvent;
import com.bekvon.bukkit.residence.event.ResidenceFlagChangeEvent;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import com.bekvon.bukkit.residence.protection.FlagPermissions.FlagState;
-public class time implements Listener {
+public class Time implements Listener {
+ @EventHandler
+ public void onResidenceChange(final ResidenceChangedEvent e) {
+ final Player player = e.getPlayer();
+ final ClaimedResidence oldRes = e.getFrom();
+ final ClaimedResidence newRes = e.getTo();
+ if (oldRes != null) {
+ if (oldRes.getPermissions().has("night", false) || oldRes.getPermissions().has("day", false)) {
+ player.resetPlayerTime();
+ }
+ }
+ if (newRes != null) {
+ if (newRes.getPermissions().has("day", false)) {
+ player.setPlayerTime(6000, false);
+ return;
+ }
+ if (newRes.getPermissions().has("night", false)) {
+ player.setPlayerTime(14000, false);
+ return;
+ }
+ }
+ }
- @EventHandler(priority = EventPriority.NORMAL)
+ @EventHandler
public void onResidenceFlag(final ResidenceFlagChangeEvent event) {
final ClaimedResidence res = event.getResidence();
if (event.getFlag().equalsIgnoreCase("day")) {
@@ -37,12 +58,7 @@ public class time implements Listener {
player.setPlayerTime(14000, false);
}
}
- if (event.getNewState() == FlagState.FALSE) {
- for (final Player player : res.getPlayersInResidence()) {
- player.resetPlayerTime();
- }
- }
- if (event.getNewState() == FlagState.NEITHER) {
+ if (event.getNewState() == FlagState.FALSE || event.getNewState() == FlagState.NEITHER) {
for (final Player player : res.getPlayersInResidence()) {
player.resetPlayerTime();
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/trade.java b/src/main/java/cn/citycraft/ResExtras/flags/Trade.java
similarity index 77%
rename from src/main/java/cn/citycraft/ResExtras/flags/trade.java
rename to src/main/java/cn/citycraft/ResExtras/flags/Trade.java
index 12cfc0f..4f421c9 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/trade.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Trade.java
@@ -12,11 +12,13 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-public class trade implements Listener {
+import cn.citycraft.ResExtras.ResExtras;
+
+public class Trade implements Listener {
ChatColor derpa = ChatColor.RED;
- @EventHandler(priority = EventPriority.NORMAL)
- public void Trade(final PlayerInteractEntityEvent event) {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onTrade(final PlayerInteractEntityEvent event) {
final Entity uglyguy = event.getRightClicked();
if (uglyguy.getType() == EntityType.VILLAGER) {
final Player player = event.getPlayer();
@@ -25,8 +27,8 @@ public class trade implements Listener {
final String playername = player.getName();
if (res != null) {
if (!res.getPermissions().playerHas(playername, "trade", true) && !resadmin) {
+ ResExtras.sendMessage(player, "Trade");
event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot trade here!");
}
}
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/VehicleProtect.java b/src/main/java/cn/citycraft/ResExtras/flags/VehicleProtect.java
new file mode 100644
index 0000000..04bc2fd
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/VehicleProtect.java
@@ -0,0 +1,60 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.ChatColor;
+import org.bukkit.Location;
+import org.bukkit.entity.Boat;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Minecart;
+import org.bukkit.entity.Monster;
+import org.bukkit.entity.Player;
+import org.bukkit.entity.Vehicle;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.vehicle.VehicleDestroyEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.ClaimedResidence;
+
+import cn.citycraft.ResExtras.ResExtras;
+
+public class VehicleProtect implements Listener {
+ ChatColor derpa = ChatColor.RED;
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onVehicleDestroy(final VehicleDestroyEvent event) {
+ try {
+ final Location loc = event.getVehicle().getLocation();
+ final Entity attacker = event.getAttacker();
+ final Vehicle vehicle = event.getVehicle();
+ final Player player = (Player) attacker;
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
+ final boolean resadmin = Residence.isResAdminOn(player);
+ final String playername = player.getName();
+ if (res != null) {
+ if (res.getPermissions().playerHas(playername, "vehicleprotect", false) && !resadmin && (vehicle instanceof Minecart || vehicle instanceof Boat)
+ && (attacker instanceof Player || attacker instanceof Monster)) {
+ ResExtras.sendMessage(player, "VehicleDestroy");
+ event.setCancelled(true);
+ return;
+ }
+ }
+ } catch (final Exception ex) {
+
+ }
+ }
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onVehicleDestroyEntity(final VehicleDestroyEvent event) {
+ final Location loc = event.getVehicle().getLocation();
+ final Entity attacker = event.getAttacker();
+ final Vehicle vehicle = event.getVehicle();
+ final ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
+ if (res != null) {
+ if (res.getPermissions().has("vehicleprotect", false) && (vehicle instanceof Minecart || vehicle instanceof Boat) && attacker instanceof Monster) {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Villager.java b/src/main/java/cn/citycraft/ResExtras/flags/Villager.java
new file mode 100644
index 0000000..59ff3bc
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Villager.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Villager implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onVillager(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Villager) {
+ if (FlagPermissions.has("villager", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/villagerkilling.java b/src/main/java/cn/citycraft/ResExtras/flags/VillagerKilling.java
similarity index 61%
rename from src/main/java/cn/citycraft/ResExtras/flags/villagerkilling.java
rename to src/main/java/cn/citycraft/ResExtras/flags/VillagerKilling.java
index 469b4ae..600f127 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/villagerkilling.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/VillagerKilling.java
@@ -1,6 +1,5 @@
package cn.citycraft.ResExtras.flags;
-import org.bukkit.ChatColor;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -13,14 +12,13 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-public class villagerkilling implements Listener {
- public Player cause;
+import cn.citycraft.ResExtras.ResExtras;
- @EventHandler(priority = EventPriority.NORMAL)
- public void VillagerKilling(final EntityDamageByEntityEvent event) {
- if (event.isCancelled()) {
- return;
- }
+public class VillagerKilling implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onVillagerKilling(final EntityDamageByEntityEvent event) {
+ Player p = null;
final Entity damager = event.getDamager();
if ((!(damager instanceof Arrow)) && (!(damager instanceof Player))) {
return;
@@ -28,20 +26,19 @@ public class villagerkilling implements Listener {
if ((damager instanceof Arrow) && (!(((Arrow) damager).getShooter() instanceof Player))) {
return;
} else if (damager instanceof Player) {
- cause = (Player) damager;
+ p = (Player) damager;
} else {
- cause = (Player) ((Arrow) damager).getShooter();
+ p = (Player) ((Arrow) damager).getShooter();
}
- final boolean resadmin = Residence.isResAdminOn(cause);
+ final boolean resadmin = Residence.isResAdminOn(p);
if (resadmin) {
return;
}
final Entity entity = event.getEntity();
final ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
-
- if (res != null && !res.getPermissions().playerHas(cause.getName().toString(), "villagerkilling", true)) {
+ if (res != null && !res.getPermissions().playerHas(p.getName().toString(), "villagerkilling", true)) {
if (entity instanceof Villager) {
- cause.sendMessage(ChatColor.RED + "You cannot kill villagers here!");
+ ResExtras.sendMessage(p, "VillagerKilling");
event.setCancelled(true);
}
}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/weather.java b/src/main/java/cn/citycraft/ResExtras/flags/Weather.java
similarity index 55%
rename from src/main/java/cn/citycraft/ResExtras/flags/weather.java
rename to src/main/java/cn/citycraft/ResExtras/flags/Weather.java
index 71acaa5..addea35 100644
--- a/src/main/java/cn/citycraft/ResExtras/flags/weather.java
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Weather.java
@@ -3,15 +3,39 @@ package cn.citycraft.ResExtras.flags;
import org.bukkit.WeatherType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
+import com.bekvon.bukkit.residence.event.ResidenceChangedEvent;
import com.bekvon.bukkit.residence.event.ResidenceFlagChangeEvent;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import com.bekvon.bukkit.residence.protection.FlagPermissions.FlagState;
-public class weather implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
+public class Weather implements Listener {
+ @EventHandler
+ public void onResidenceChange(final ResidenceChangedEvent e) {
+ final Player player = e.getPlayer();
+ final ClaimedResidence oldRes = e.getFrom();
+ final ClaimedResidence newRes = e.getTo();
+ if (oldRes != null) {
+ if (oldRes.getPermissions().isSet("weather")) {
+ player.resetPlayerWeather();
+ }
+ }
+ if (newRes != null) {
+ if (newRes.getPermissions().isSet("weather")) {
+ if (newRes.getPermissions().has("weather", true)) {
+ player.setPlayerWeather(WeatherType.DOWNFALL);
+ return;
+ }
+ if (!newRes.getPermissions().has("weather", false)) {
+ player.setPlayerWeather(WeatherType.CLEAR);
+ return;
+ }
+ }
+ }
+ }
+
+ @EventHandler
public void onResidenceFlag(final ResidenceFlagChangeEvent event) {
if (event.getFlag().equalsIgnoreCase("weather")) {
final ClaimedResidence res = event.getResidence();
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Witch.java b/src/main/java/cn/citycraft/ResExtras/flags/Witch.java
new file mode 100644
index 0000000..020be55
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Witch.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Witch implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onWitch(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Witch) {
+ if (FlagPermissions.has("witch", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/WitherSpawn.java b/src/main/java/cn/citycraft/ResExtras/flags/WitherSpawn.java
new file mode 100644
index 0000000..c6ec579
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/WitherSpawn.java
@@ -0,0 +1,25 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class WitherSpawn implements Listener {
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onWitherSpawn(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Wither) {
+ if (FlagPermissions.has("Witherspawn", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Wolf.java b/src/main/java/cn/citycraft/ResExtras/flags/Wolf.java
new file mode 100644
index 0000000..6c17a02
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Wolf.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Wolf implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onWolf(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Wolf) {
+ if (FlagPermissions.has("wolf", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/Zombie.java b/src/main/java/cn/citycraft/ResExtras/flags/Zombie.java
new file mode 100644
index 0000000..6a515eb
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/Zombie.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class Zombie implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onZombie(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.Zombie) {
+ if (FlagPermissions.has("zombie", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/ZombiePigmen.java b/src/main/java/cn/citycraft/ResExtras/flags/ZombiePigmen.java
new file mode 100644
index 0000000..d5dee7a
--- /dev/null
+++ b/src/main/java/cn/citycraft/ResExtras/flags/ZombiePigmen.java
@@ -0,0 +1,26 @@
+package cn.citycraft.ResExtras.flags;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+
+public class ZombiePigmen implements Listener {
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onZombiePigmen(final CreatureSpawnEvent event) {
+ final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
+ final LivingEntity Entity = event.getEntity();
+ if (FlagPermissions == null)
+ return;
+ if (Entity instanceof org.bukkit.entity.PigZombie) {
+ if (FlagPermissions.has("zombiepigmen", true))
+ return;
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/bat.java b/src/main/java/cn/citycraft/ResExtras/flags/bat.java
deleted file mode 100644
index b7a32b2..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/bat.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Bat;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class bat implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Bat(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Bat)
- {
- if (FlagPermissions.has("bat", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/blaze.java b/src/main/java/cn/citycraft/ResExtras/flags/blaze.java
deleted file mode 100644
index 3d895ad..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/blaze.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Blaze;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class blaze implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Blaze(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Blaze)
- {
- if (FlagPermissions.has("blaze", true))
- return;
- event.setCancelled(true);
- }
-}
-}
-
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/blockdamage.java b/src/main/java/cn/citycraft/ResExtras/flags/blockdamage.java
deleted file mode 100644
index c87d72b..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/blockdamage.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityExplodeEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class blockdamage implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void BlockDamage(EntityExplodeEvent event) {
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("blockdamage", true)) {
- event.setCancelled(true);
- }
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/cavespider.java b/src/main/java/cn/citycraft/ResExtras/flags/cavespider.java
deleted file mode 100644
index ae93401..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/cavespider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.CaveSpider;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class cavespider implements Listener {
-
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void CaveSpider(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof CaveSpider)
- {
- if (FlagPermissions.has("cavespider", true))
- return;
- event.setCancelled(true);
- }
-}
-}
-
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/chicken.java b/src/main/java/cn/citycraft/ResExtras/flags/chicken.java
deleted file mode 100644
index 6370c0d..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/chicken.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Chicken;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class chicken implements Listener {
-
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Chicken(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Chicken)
- {
- if (FlagPermissions.has("chicken", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/commands.java b/src/main/java/cn/citycraft/ResExtras/flags/commands.java
deleted file mode 100644
index 9df2fc8..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/commands.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.Location;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerCommandPreprocessEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class commands implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Commands(PlayerCommandPreprocessEvent event){
- Player player = event.getPlayer();
- Location loc = event.getPlayer().getLocation();
- boolean resadmin = Residence.isResAdminOn(player);
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
- String playername = player.getName();
- if(res!=null && !res.getPermissions().playerHas(playername, "commands", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot use commands here!");
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/cow.java b/src/main/java/cn/citycraft/ResExtras/flags/cow.java
deleted file mode 100644
index ba802eb..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/cow.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Cow;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class cow implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Cow(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Cow)
- {
- if (FlagPermissions.has("cow", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/creeperspawn.java b/src/main/java/cn/citycraft/ResExtras/flags/creeperspawn.java
deleted file mode 100644
index 9edfa3a..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/creeperspawn.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Creeper;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class creeperspawn implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void CreeperSpawn(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Creeper)
- {
- if (FlagPermissions.has("creeperspawn", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/drops.java b/src/main/java/cn/citycraft/ResExtras/flags/drops.java
deleted file mode 100644
index b388167..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/drops.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerDropItemEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class drops implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Drops(PlayerDropItemEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- boolean resadmin = Residence.isResAdminOn(player);
- ClaimedResidence res = Residence.getResidenceManager().getByLoc (event.getItemDrop().getLocation());
- String playername = player.getName();
- if(res!=null){
- if(!res.getPermissions().playerHas(playername, "drops", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot drop items here!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/eggs.java b/src/main/java/cn/citycraft/ResExtras/flags/eggs.java
deleted file mode 100644
index 0a6abe7..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/eggs.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerEggThrowEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class eggs implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Eggs(PlayerEggThrowEvent event){
- Player player = event.getPlayer();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null) {
- if(!res.getPermissions().playerHas(playername, "eggs", true) && !resadmin) {
- event.setHatching(false);
- event.getPlayer().sendMessage(derpa + "You cannot throw eggys!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/enderman.java b/src/main/java/cn/citycraft/ResExtras/flags/enderman.java
deleted file mode 100644
index 9bb4eec..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/enderman.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Enderman;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class enderman implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Enderman(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Enderman)
- {
- if (FlagPermissions.has("enderman", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/enderpearl.java b/src/main/java/cn/citycraft/ResExtras/flags/enderpearl.java
deleted file mode 100644
index b4d25cd..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/enderpearl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.Location;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerTeleportEvent;
-import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class enderpearl implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Enderpearl(PlayerTeleportEvent event){
- if(event.isCancelled())
- return;
- Location loc = event.getTo();
- Player player = event.getPlayer();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null){
- if(event.getCause()==TeleportCause.ENDER_PEARL && !res.getPermissions().playerHas(playername, "enderpearl", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot use ender pearls here!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/falldamage.java b/src/main/java/cn/citycraft/ResExtras/flags/falldamage.java
deleted file mode 100644
index 21fb72f..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/falldamage.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageEvent;
-import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class falldamage implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void FallDamage(EntityDamageEvent event){
- if(event.isCancelled())
- return;
- Entity entity = event.getEntity();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
- if(event.getCause() == DamageCause.FALL && event.getEntity() instanceof Player){
- if(res!=null){
- if(!res.getPermissions().has("falldamage", true)){
- event.setCancelled(true);
- }
- }
- }
- }
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/fishing.java b/src/main/java/cn/citycraft/ResExtras/flags/fishing.java
deleted file mode 100644
index 6b1b3bc..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/fishing.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerFishEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class fishing implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Fishing(PlayerFishEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null) {
- if(!res.getPermissions().playerHas(playername, "fishing", true) && !resadmin) {
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot fish here!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/form.java b/src/main/java/cn/citycraft/ResExtras/flags/form.java
deleted file mode 100644
index c4efcab..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/form.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.block.BlockFormEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class form implements Listener {
- @EventHandler(priority = EventPriority.LOW)
- public void Form(BlockFormEvent event) {
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("form", true)) {
- event.setCancelled(true);
- }
- }
- else {
- if (!Residence.getWorldFlags().getPerms(event.getBlock().getWorld().getName()).has("form", true)) {
- event.setCancelled(true);
- }
- }
- }
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/ghast.java b/src/main/java/cn/citycraft/ResExtras/flags/ghast.java
deleted file mode 100644
index 767b734..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/ghast.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Ghast;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class ghast implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Ghast(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Ghast)
- {
- if (FlagPermissions.has("ghast", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/god.java b/src/main/java/cn/citycraft/ResExtras/flags/god.java
deleted file mode 100644
index 3707412..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/god.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.Effect;
-import org.bukkit.Location;
-import org.bukkit.World;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageEvent;
-
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class god implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void God(EntityDamageEvent event){
- if(event.isCancelled())
- return;
- try {
- Entity entity = event.getEntity();
- Player player = ((Player) event.getEntity());
- World world = player.getWorld();
- String playername = player.getName();
- Location location = player.getLocation();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(entity.getLocation());
- if(event.getEntity() instanceof Player){
- if(res!=null){
- if(res.getPermissions().playerHas(playername, "god", false)){
- event.setCancelled(true);
- world.playEffect(location, Effect.MOBSPAWNER_FLAMES, 4);
- }
- }
- }
- } catch (Exception ex) {
-
- }
- }
- }
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/grow.java b/src/main/java/cn/citycraft/ResExtras/flags/grow.java
deleted file mode 100644
index f42f91a..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/grow.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.block.BlockGrowEvent;
-import org.bukkit.event.block.BlockSpreadEvent;
-import org.bukkit.event.world.StructureGrowEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class grow implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void StructureGrow(StructureGrowEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("grow", true)) {
- event.setCancelled(true);
- return;
- }
- }
- }
-@EventHandler(priority = EventPriority.NORMAL)
-public void BlockGrow(BlockGrowEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("grow", true)) {
- event.setCancelled(true);
- return;
- }
- }
-}
-@EventHandler(priority = EventPriority.NORMAL)
-public void BlockGrowSpread(BlockSpreadEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("grow", true)) {
- event.setCancelled(true);
- return;
- }
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/hunger.java b/src/main/java/cn/citycraft/ResExtras/flags/hunger.java
deleted file mode 100644
index 0fd8f94..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/hunger.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.FoodLevelChangeEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class hunger implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Hunger(FoodLevelChangeEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("hunger", true)) {
- event.setCancelled(true);
- return;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/irongolem.java b/src/main/java/cn/citycraft/ResExtras/flags/irongolem.java
deleted file mode 100644
index 0d94c75..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/irongolem.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.IronGolem;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class irongolem implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void IronGolem(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof IronGolem)
- {
- if (FlagPermissions.has("irongolem", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/lightning.java b/src/main/java/cn/citycraft/ResExtras/flags/lightning.java
deleted file mode 100644
index 6424d30..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/lightning.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.weather.LightningStrikeEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class lightning implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Lightning(LightningStrikeEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getLightning().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("lightning", true)) {
- event.setCancelled(true);
- return;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/magmacube.java b/src/main/java/cn/citycraft/ResExtras/flags/magmacube.java
deleted file mode 100644
index 471a57e..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/magmacube.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.MagmaCube;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class magmacube implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void MagmaCube(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof MagmaCube)
- {
- if (FlagPermissions.has("magmacube", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/melt.java b/src/main/java/cn/citycraft/ResExtras/flags/melt.java
deleted file mode 100644
index 67b87f4..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/melt.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.block.BlockFadeEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class melt implements Listener {
- @EventHandler(priority = EventPriority.LOW)
- public void Melt(BlockFadeEvent event) {
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getBlock().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("melt", true)) {
- event.setCancelled(true);
- }
- }
- else {
- if (!Residence.getWorldFlags().getPerms(event.getBlock().getWorld().getName()).has("melt", true)) {
- event.setCancelled(true);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/mooshroom.java b/src/main/java/cn/citycraft/ResExtras/flags/mooshroom.java
deleted file mode 100644
index 00436b0..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/mooshroom.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.MushroomCow;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class mooshroom implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Mooshroom(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof MushroomCow)
- {
- if (FlagPermissions.has("mooshroom", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/ocelot.java b/src/main/java/cn/citycraft/ResExtras/flags/ocelot.java
deleted file mode 100644
index 78452bc..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/ocelot.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Ocelot;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class ocelot implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Ocelot(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Ocelot)
- {
- if (FlagPermissions.has("ocelot", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/pickup.java b/src/main/java/cn/citycraft/ResExtras/flags/pickup.java
deleted file mode 100644
index cfc3728..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/pickup.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerPickupItemEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class pickup implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void PickupItem(PlayerPickupItemEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- boolean resadmin = Residence.isResAdminOn(player);
- ClaimedResidence res = Residence.getResidenceManager().getByLoc (event.getItem().getLocation());
- String playername = player.getName();
- if(res!=null){
- if(!res.getPermissions().playerHas(playername, "pickup", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot pickup items here!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/pig.java b/src/main/java/cn/citycraft/ResExtras/flags/pig.java
deleted file mode 100644
index 66de0ab..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/pig.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Pig;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class pig implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Pig(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Pig)
- {
- if (FlagPermissions.has("pig", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/pigsaddle.java b/src/main/java/cn/citycraft/ResExtras/flags/pigsaddle.java
deleted file mode 100644
index b412b7f..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/pigsaddle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.EntityType;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerInteractEntityEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class pigsaddle implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void PiggySaddle(PlayerInteractEntityEvent event){
- if(event.isCancelled())
- return;
- Entity pig = event.getRightClicked();
- Player player = event.getPlayer();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null) {
- if(!res.getPermissions().playerHas(playername, "pigsaddle", true)&&!resadmin) {
- if(pig.getType() == EntityType.PIG){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot derp here!");
- }
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/pigzap.java b/src/main/java/cn/citycraft/ResExtras/flags/pigzap.java
deleted file mode 100644
index b77a69a..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/pigzap.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.PigZapEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class pigzap implements Listener {
-
-@EventHandler(priority = EventPriority.NORMAL)
-public void PiggyZap(PigZapEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("pigzap", true)) {
- event.setCancelled(true);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/portal.java b/src/main/java/cn/citycraft/ResExtras/flags/portal.java
deleted file mode 100644
index 36e35ce..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/portal.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.Location;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerPortalEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class portal implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Portal(PlayerPortalEvent event){
- Player player = event.getPlayer();
- Location loc = event.getPlayer().getLocation();
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null){
- if(!res.getPermissions().playerHas(playername, "portal", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot use portals here!");
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/shear.java b/src/main/java/cn/citycraft/ResExtras/flags/shear.java
deleted file mode 100644
index afd8363..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/shear.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerShearEntityEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class shear implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Shear(PlayerShearEntityEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null && !res.getPermissions().playerHas(playername, "shear", true)&&!resadmin){
- event.setCancelled(true);
- event.getPlayer().sendMessage(derpa + "You cannot shear here!");
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/sheep.java b/src/main/java/cn/citycraft/ResExtras/flags/sheep.java
deleted file mode 100644
index 7a11c91..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/sheep.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Sheep;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class sheep implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Sheep(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Sheep)
- {
- if (FlagPermissions.has("sheep", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/silverfish.java b/src/main/java/cn/citycraft/ResExtras/flags/silverfish.java
deleted file mode 100644
index ecd85b0..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/silverfish.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Silverfish;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class silverfish implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Silverfish(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Silverfish)
- {
- if (FlagPermissions.has("silverfish", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/skeleton.java b/src/main/java/cn/citycraft/ResExtras/flags/skeleton.java
deleted file mode 100644
index 060b553..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/skeleton.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Skeleton;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class skeleton implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Skeleton(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Skeleton)
- {
- if (FlagPermissions.has("skeleton", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/slime.java b/src/main/java/cn/citycraft/ResExtras/flags/slime.java
deleted file mode 100644
index aca6d29..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/slime.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Slime;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class slime implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Slime(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Slime)
- {
- if (FlagPermissions.has("slime", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/slimesplit.java b/src/main/java/cn/citycraft/ResExtras/flags/slimesplit.java
deleted file mode 100644
index 0819b2a..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/slimesplit.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.SlimeSplitEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class slimesplit implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void SlimeSplit(SlimeSplitEvent event){
- if(event.isCancelled())
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getEntity().getLocation());
- if(res!=null) {
- if(!res.getPermissions().has("slimesplit", true)) {
- event.setCancelled(true);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/sneak.java b/src/main/java/cn/citycraft/ResExtras/flags/sneak.java
deleted file mode 100644
index ddc389f..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/sneak.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerMoveEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class sneak implements Listener {
- @EventHandler(priority = EventPriority.MONITOR)
- public void Sneak(PlayerMoveEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- if(!player.isSprinting() && (!player.isSneaking()))
- return;
- boolean resadmin = Residence.isResAdminOn(player);
- if (resadmin) {
- return;
- }
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- String playername = player.getName();
- if(res!=null) {
- if(!res.getPermissions().playerHas(playername, "sneak", true) && player.isSneaking()) {
- long currentTime = System.currentTimeMillis();
- if(currentTime%2000>=0 && currentTime%2000<=100){
- event.setCancelled(true);
- player.sendMessage(derpa + "You cannot sneak here!");
- return;
- }
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/snowgolem.java b/src/main/java/cn/citycraft/ResExtras/flags/snowgolem.java
deleted file mode 100644
index 7749f2a..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/snowgolem.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Snowman;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class snowgolem implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void SnowGolem(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Snowman)
- {
- if (FlagPermissions.has("snowgolem", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/spider.java b/src/main/java/cn/citycraft/ResExtras/flags/spider.java
deleted file mode 100644
index b4e38a6..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/spider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Spider;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class spider implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Spider(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Spider)
- {
- if (FlagPermissions.has("spider", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/sprint.java b/src/main/java/cn/citycraft/ResExtras/flags/sprint.java
deleted file mode 100644
index 32a6f23..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/sprint.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerMoveEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class sprint implements Listener {
- @EventHandler(priority = EventPriority.MONITOR)
- public void Sprint(PlayerMoveEvent event){
- if(event.isCancelled())
- return;
- Player player = event.getPlayer();
- String playername = player.getName();
- boolean resadmin = Residence.isResAdminOn(player);
- if (resadmin) {
- return;
- }
- if(!player.isSprinting() && (!player.isSneaking()))
- return;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
- if(res!=null) {
- if(!res.getPermissions().playerHas(playername, "sprint", true) && player.isSprinting()) {
- event.setCancelled(true);
- long currentTime = System.currentTimeMillis();
- if(currentTime%2000>=0 && currentTime%2000<=100){
- event.getPlayer().sendMessage(derpa + "You cannot sprint here!");
- return;
- }
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/squid.java b/src/main/java/cn/citycraft/ResExtras/flags/squid.java
deleted file mode 100644
index 203ed94..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/squid.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Squid;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class squid implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void Squid(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Squid)
- {
- if (FlagPermissions.has("squid", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/vehicleprotect.java b/src/main/java/cn/citycraft/ResExtras/flags/vehicleprotect.java
deleted file mode 100644
index 73ee81c..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/vehicleprotect.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.ChatColor;
-import org.bukkit.Location;
-import org.bukkit.entity.Boat;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Minecart;
-import org.bukkit.entity.Monster;
-import org.bukkit.entity.Player;
-import org.bukkit.entity.Vehicle;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.vehicle.VehicleDestroyEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.ClaimedResidence;
-
-public class vehicleprotect implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void onVehicleDestroy(VehicleDestroyEvent event){
- if(event.isCancelled())
- return;
- try {
- Location loc = event.getVehicle().getLocation();
- Entity attacker = event.getAttacker();
- Vehicle vehicle = event.getVehicle();
- Player player;
- player = (Player)attacker;
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
- boolean resadmin = Residence.isResAdminOn(player);
- String playername = player.getName();
- if(res!=null){
- if(res.getPermissions().playerHas(playername, "vehicleprotect", false) && !resadmin && (vehicle instanceof Minecart || vehicle instanceof Boat) && (attacker instanceof Player || attacker instanceof Monster)){
- event.setCancelled(true);
- player.sendMessage(derpa + "You cannot destroy vehicles here!");
- return;
- }
- }
- } catch (Exception ex) {
-
- }
- }
- @EventHandler(priority = EventPriority.NORMAL)
- public void onVehicleDestroyEntity(VehicleDestroyEvent event){
- if(event.isCancelled())
- return;
- Location loc = event.getVehicle().getLocation();
- Entity attacker = event.getAttacker();
- Vehicle vehicle = event.getVehicle();
- ClaimedResidence res = Residence.getResidenceManager().getByLoc(loc);
- if(res!=null){
- if(res.getPermissions().has("vehicleprotect", false) && (vehicle instanceof Minecart || vehicle instanceof Boat) && attacker instanceof Monster){
- event.setCancelled(true);
- return;
- }
- }
- }
- ChatColor derpa = ChatColor.RED;
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/villager.java b/src/main/java/cn/citycraft/ResExtras/flags/villager.java
deleted file mode 100644
index 5513462..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/villager.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Villager;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class villager implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Villager(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Villager)
- {
- if (FlagPermissions.has("villager", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/witch.java b/src/main/java/cn/citycraft/ResExtras/flags/witch.java
deleted file mode 100644
index 2127ca6..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/witch.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Witch;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class witch implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Witch(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Witch)
- {
- if (FlagPermissions.has("witch", true))
- return;
- event.setCancelled(true);
- }
-}
-}
\ No newline at end of file
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/witherspawn.java b/src/main/java/cn/citycraft/ResExtras/flags/witherspawn.java
deleted file mode 100644
index e97c33c..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/witherspawn.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Wither;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class witherspawn implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void WitherSpawn(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Wither)
- {
- if (FlagPermissions.has("Witherspawn", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/wolf.java b/src/main/java/cn/citycraft/ResExtras/flags/wolf.java
deleted file mode 100644
index 1a5a085..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/wolf.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Wolf;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class wolf implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Wolf(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Wolf)
- {
- if (FlagPermissions.has("wolf", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/zombie.java b/src/main/java/cn/citycraft/ResExtras/flags/zombie.java
deleted file mode 100644
index 1b0b750..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/zombie.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.Zombie;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class zombie implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void Zombie(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof Zombie)
- {
- if (FlagPermissions.has("zombie", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/java/cn/citycraft/ResExtras/flags/zombiepigmen.java b/src/main/java/cn/citycraft/ResExtras/flags/zombiepigmen.java
deleted file mode 100644
index 1f44325..0000000
--- a/src/main/java/cn/citycraft/ResExtras/flags/zombiepigmen.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package cn.citycraft.ResExtras.flags;
-
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.PigZombie;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import com.bekvon.bukkit.residence.Residence;
-import com.bekvon.bukkit.residence.protection.FlagPermissions;
-
-public class zombiepigmen implements Listener {
-
- @EventHandler(priority = EventPriority.NORMAL)
- public void ZombiePigmen(CreatureSpawnEvent event)
- {
- FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
- LivingEntity Entity = event.getEntity();
- if (FlagPermissions == null)
- return;
- if (Entity instanceof PigZombie)
- {
- if (FlagPermissions.has("zombiepigmen", true))
- return;
- event.setCancelled(true);
- }
-}
-}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 09db536..d93493e 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -1,54 +1,74 @@
-Zombie: true
-Skeleton: true
-Spider: true
-Creeperspawn: true
-Blaze: true
-Cavespider: true
-Ghast: true
-Slime: true
-Magmacube: true
-Silverfish: true
-Snowgolem: true
-Irongolem: true
-Enderman: true
-Zombiepigmen: true
-Chicken: true
-Cow: true
-Mooshroom: true
-Ocelot: true
-Pig: true
-Sheep: true
-Squid: true
-Villager: true
-Wolf: true
-Bat: true
-Witherspawn: true
-Witch: true
-Form: true
-Melt: true
-Commands: true
-Falldamage: true
-Portal: true
-Enderpearl: true
-Mobkilling: true
-Animalkilling: true
-Villagerkilling: true
-Drops: true
-Pickup: true
-Vehicleprotect: true
-Lightning: true
-Grow: true
-Hunger: true
-Sprint: true
-Fishing: true
-Eggs: true
-Sneak: true
-Pigzap: true
-Slimesplit: true
-Shear: true
-Pigsaddle: true
-Trade: true
-God: true
-Time: true
-Weather: true
-BlockDamage: true
\ No newline at end of file
+Version: 1.1
+pluginname: '&6[&b领地扩展&6]&r '
+Flags:
+ Zombie: true
+ Skeleton: true
+ Spider: true
+ Creeperspawn: true
+ Blaze: true
+ Cavespider: true
+ Ghast: true
+ Slime: true
+ Magmacube: true
+ Silverfish: true
+ Snowgolem: true
+ Irongolem: true
+ Enderman: true
+ Zombiepigmen: true
+ Chicken: true
+ Cow: true
+ Mooshroom: true
+ Ocelot: true
+ Pig: true
+ Sheep: true
+ Squid: true
+ Villager: true
+ Wolf: true
+ Bat: true
+ Witherspawn: true
+ Witch: true
+ Form: true
+ Melt: true
+ Commands: true
+ Falldamage: true
+ Portal: true
+ Enderpearl: true
+ Mobkilling: true
+ Animalkilling: true
+ Villagerkilling: true
+ DropItem: true
+ PickupItem: true
+ Vehicleprotect: true
+ Lightning: true
+ Grow: true
+ Hunger: true
+ Sprint: true
+ Fishing: true
+ Eggs: true
+ Sneak: true
+ Pigzap: true
+ Slimesplit: true
+ Shear: true
+ Pigsaddle: true
+ Trade: true
+ God: true
+ Time: true
+ Weather: true
+ BlockDamage: true
+Message:
+ Animalkilling: '当前区域不允许击杀动物!'
+ Commands: '当前区域不允许执行命令!'
+ DropItem: '当前区域不允许丢弃物品!'
+ Eggs: '当前区域不允许投掷鸡蛋!'
+ EnderPearl: '当前区域不允许传送到末地!'
+ Fishing: '当前区域不允许钓鱼!'
+ Mobkilling: '当前区域不允许击杀怪物!'
+ PickupItem: '当前区域不允许拾取物品!'
+ PiggySaddle: '当前区域不允许使用猪鞍!'
+ Pearl: '当前区域不允许传送到地狱!'
+ Shear: '当前区域不允许剪羊毛!'
+ Sneak: '当前区域不允许蹲下!'
+ Sprint: '当前区域不允许冲刺!'
+ Trade: '当前区域不允许交易!'
+ VehicleDestroy: '当前区域不允许摧毁矿车'
+ VillagerKilling: '当前区域不允许击杀村民!'
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 7d3bc74..f36bcbf 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -19,4 +19,7 @@ permissions:
default: true
ResExtras.help:
description: 显示帮助菜单
- default: true
\ No newline at end of file
+ default: true
+ ResExtras.reload:
+ description: 重载插件
+ default: op
\ No newline at end of file