mirror of
https://e.coding.net/circlecloud/ProtectItem.git
synced 2024-12-27 20:48:51 +00:00
fix can't load this plugin...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
57fc847fe6
commit
7b65793c44
@ -3,7 +3,10 @@ package cn.citycraft.ProtectItem;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import cn.citycraft.ProtectItem.listen.BreakBlockListen;
|
||||
@ -38,6 +41,32 @@ public class Main extends JavaPlugin {
|
||||
getLogger().info("ProtectItem已加载!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String string,
|
||||
String[] args) {
|
||||
Player p = (Player) sender;
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
ItemStack item = p.getItemInHand();
|
||||
p.sendMessage("手上物品类型名称为: " + item.getType().name());
|
||||
return true;
|
||||
case 1:
|
||||
switch (args[0]) {
|
||||
case "reload":
|
||||
this.reloadConfig();
|
||||
p.sendMessage("\u00a7a配置文件已重载...");
|
||||
return true;
|
||||
case "add":
|
||||
case "del":
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkevent(Player p, String i, String type) {
|
||||
if (p.hasPermission("pi.bypass"))
|
||||
return false;
|
||||
|
@ -11,7 +11,6 @@ public class BreakBlockListen implements Listener {
|
||||
Main plugin;
|
||||
|
||||
public BreakBlockListen(Main main) {
|
||||
// TODO Auto-generated constructor stub
|
||||
plugin = main;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ public class DropItemListen implements Listener {
|
||||
Main plugin;
|
||||
|
||||
public DropItemListen(Main main) {
|
||||
// TODO Auto-generated constructor stub
|
||||
plugin = main;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ public class PickupItemListen implements Listener {
|
||||
Main plugin;
|
||||
|
||||
public PickupItemListen(Main main) {
|
||||
// TODO Auto-generated constructor stub
|
||||
plugin = main;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ public class PlaceBlockListen implements Listener {
|
||||
Main plugin;
|
||||
|
||||
public PlaceBlockListen(Main main) {
|
||||
// TODO Auto-generated constructor stub
|
||||
plugin = main;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,8 @@ ProtectWorld:
|
||||
|
||||
#保护的物品(不区分大小写)
|
||||
ProtectItem:
|
||||
- DIRT
|
||||
- GRASS
|
||||
- CHEST
|
||||
- TRAPPED_CHEST
|
||||
#例如(请输入物品类型名称,/pishow查看物品名称)
|
||||
# - DIRT
|
||||
# - GRASS
|
||||
# - CHEST
|
||||
# - TRAPPED_CHEST
|
||||
|
@ -1,6 +1,11 @@
|
||||
name: ProtectItem
|
||||
main: cn.CityCraft.ProtectItem.Main
|
||||
main: cn.citycraft.ProtectItem.Main
|
||||
version: 1.0
|
||||
auther: 喵♂呜
|
||||
commands:
|
||||
pishow:
|
||||
description: 物品保护插件
|
||||
usage: 使用/pishow 查看物品名称!
|
||||
permissions:
|
||||
pi.bypass:
|
||||
default: op
|
Loading…
Reference in New Issue
Block a user