diff --git a/.gitignore b/.gitignore index 78186a5..7d5bd72 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .classpath .settings .project -bin/ \ No newline at end of file +bin/ +/target/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..27225bd --- /dev/null +++ b/pom.xml @@ -0,0 +1,35 @@ + + 4.0.0 + cn.CityCraft + BanDropDirt + 0.0.1-SNAPSHOT + BanDropDirt + + src + + + src + + **/*.java + + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + + + org.spigotmc + spigot + jar + 1.8-R0.1-SNAPSHOT + + + + UTF-8 + + \ No newline at end of file diff --git a/src/com/github/j502647092/BanDropDirt/Main.java b/src/cn/CityCraft/ProtectItem/Main.java similarity index 59% rename from src/com/github/j502647092/BanDropDirt/Main.java rename to src/cn/CityCraft/ProtectItem/Main.java index 6532a81..fc98dc2 100644 --- a/src/com/github/j502647092/BanDropDirt/Main.java +++ b/src/cn/CityCraft/ProtectItem/Main.java @@ -1,4 +1,4 @@ -package com.github.j502647092.BanDropDirt; +package cn.CityCraft.ProtectItem; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -6,10 +6,10 @@ import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import com.github.j502647092.BanDropDirt.listen.BreakBlockListen; -import com.github.j502647092.BanDropDirt.listen.DropItemListen; -import com.github.j502647092.BanDropDirt.listen.PickupItemListen; -import com.github.j502647092.BanDropDirt.listen.PlaceBlockListen; +import cn.CityCraft.ProtectItem.listen.BreakBlockListen; +import cn.CityCraft.ProtectItem.listen.DropItemListen; +import cn.CityCraft.ProtectItem.listen.PickupItemListen; +import cn.CityCraft.ProtectItem.listen.PlaceBlockListen; public class Main extends JavaPlugin { public String servername; @@ -23,14 +23,18 @@ public class Main extends JavaPlugin { } public void onEnable() { - Bukkit.getPluginManager() - .registerEvents(new DropItemListen(this), this); - Bukkit.getPluginManager().registerEvents(new PickupItemListen(this), - this); - Bukkit.getPluginManager().registerEvents(new BreakBlockListen(this), - this); - Bukkit.getPluginManager().registerEvents(new PlaceBlockListen(this), - this); + if (getConfig().getBoolean("Protect.Drop", true)) + Bukkit.getPluginManager().registerEvents(new DropItemListen(this), + this); + if (getConfig().getBoolean("Protect.Pickup", true)) + Bukkit.getPluginManager().registerEvents( + new PickupItemListen(this), this); + if (getConfig().getBoolean("Protect.Break", true)) + Bukkit.getPluginManager().registerEvents( + new BreakBlockListen(this), this); + if (getConfig().getBoolean("Protect.Place", true)) + Bukkit.getPluginManager().registerEvents( + new PlaceBlockListen(this), this); getLogger().info("BanDropDirt已加载!"); } diff --git a/src/com/github/j502647092/BanDropDirt/listen/BreakBlockListen.java b/src/cn/CityCraft/ProtectItem/listen/BreakBlockListen.java similarity index 84% rename from src/com/github/j502647092/BanDropDirt/listen/BreakBlockListen.java rename to src/cn/CityCraft/ProtectItem/listen/BreakBlockListen.java index 875216a..5918e52 100644 --- a/src/com/github/j502647092/BanDropDirt/listen/BreakBlockListen.java +++ b/src/cn/CityCraft/ProtectItem/listen/BreakBlockListen.java @@ -1,11 +1,11 @@ -package com.github.j502647092.BanDropDirt.listen; +package cn.CityCraft.ProtectItem.listen; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; -import com.github.j502647092.BanDropDirt.Main; +import cn.CityCraft.ProtectItem.Main; public class BreakBlockListen implements Listener { Main plugin; diff --git a/src/com/github/j502647092/BanDropDirt/listen/DropItemListen.java b/src/cn/CityCraft/ProtectItem/listen/DropItemListen.java similarity index 85% rename from src/com/github/j502647092/BanDropDirt/listen/DropItemListen.java rename to src/cn/CityCraft/ProtectItem/listen/DropItemListen.java index 53cafbe..57aaf63 100644 --- a/src/com/github/j502647092/BanDropDirt/listen/DropItemListen.java +++ b/src/cn/CityCraft/ProtectItem/listen/DropItemListen.java @@ -1,11 +1,11 @@ -package com.github.j502647092.BanDropDirt.listen; +package cn.CityCraft.ProtectItem.listen; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerDropItemEvent; -import com.github.j502647092.BanDropDirt.Main; +import cn.CityCraft.ProtectItem.Main; public class DropItemListen implements Listener { Main plugin; diff --git a/src/com/github/j502647092/BanDropDirt/listen/PickupItemListen.java b/src/cn/CityCraft/ProtectItem/listen/PickupItemListen.java similarity index 85% rename from src/com/github/j502647092/BanDropDirt/listen/PickupItemListen.java rename to src/cn/CityCraft/ProtectItem/listen/PickupItemListen.java index eed921b..26c3d7e 100644 --- a/src/com/github/j502647092/BanDropDirt/listen/PickupItemListen.java +++ b/src/cn/CityCraft/ProtectItem/listen/PickupItemListen.java @@ -1,11 +1,11 @@ -package com.github.j502647092.BanDropDirt.listen; +package cn.CityCraft.ProtectItem.listen; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerPickupItemEvent; -import com.github.j502647092.BanDropDirt.Main; +import cn.CityCraft.ProtectItem.Main; public class PickupItemListen implements Listener { Main plugin; diff --git a/src/com/github/j502647092/BanDropDirt/listen/PlaceBlockListen.java b/src/cn/CityCraft/ProtectItem/listen/PlaceBlockListen.java similarity index 84% rename from src/com/github/j502647092/BanDropDirt/listen/PlaceBlockListen.java rename to src/cn/CityCraft/ProtectItem/listen/PlaceBlockListen.java index c7732b8..5811c49 100644 --- a/src/com/github/j502647092/BanDropDirt/listen/PlaceBlockListen.java +++ b/src/cn/CityCraft/ProtectItem/listen/PlaceBlockListen.java @@ -1,11 +1,11 @@ -package com.github.j502647092.BanDropDirt.listen; +package cn.CityCraft.ProtectItem.listen; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; -import com.github.j502647092.BanDropDirt.Main; +import cn.CityCraft.ProtectItem.Main; public class PlaceBlockListen implements Listener { Main plugin; diff --git a/src/config.yml b/src/config.yml index a8119c2..38f07f7 100644 --- a/src/config.yml +++ b/src/config.yml @@ -12,6 +12,14 @@ Message: Pickup: '&cµ±Ç°ÊÀ½ç½ûֹʰȡÄàÍÁ,Ê°È¡µÄÄàÍÁÒÑÇå¿Õ£¡' Place: '&cµ±Ç°ÊÀ½ç½ûÖ¹·ÅÖÃÄàÍÁ,Ïä×Ó£¡' Break: '&cµ±Ç°ÊÀ½ç½ûÖ¹ÆÆ»µÄàÍÁ,Ïä×Ó£¡' + +#Êܵ½±£»¤µÄÀàÐÍ +Protect: + Drop: true + Pickup: true + Place: true + Break: true + #Êܵ½±£»¤µÄÊÀ½ç(²»Çø·Ö´óСд) ProtectWorld: - world