1
0
mirror of https://e.coding.net/circlecloud/ProtectItem.git synced 2024-12-26 20:38:49 +00:00

更新项目数据

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-04-28 15:44:46 +08:00
parent 2264925f6a
commit d0f3d53f7f
8 changed files with 70 additions and 22 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@
.classpath
.settings
.project
bin/
bin/
/target/

35
pom.xml Normal file
View File

@ -0,0 +1,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.CityCraft</groupId>
<artifactId>BanDropDirt</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>BanDropDirt</name>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<type>jar</type>
<version>1.8-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -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已加载!");
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -12,6 +12,14 @@ Message:
Pickup: '&c当前世界禁止拾取泥土,拾取的泥土已清空!'
Place: '&c当前世界禁止放置泥土,箱子!'
Break: '&c当前世界禁止破坏泥土,箱子!'
#受到保护的类型
Protect:
Drop: true
Pickup: true
Place: true
Break: true
#受到保护的世界(不区分大小写)
ProtectWorld:
- world