mirror of
https://e.coding.net/circlecloud/ProtectItem.git
synced 2025-11-24 23:56:08 +00:00
@@ -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:
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ(<28><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>Сд)
|
||||
ProtectItem:
|
||||
- DIRT
|
||||
- GRASS
|
||||
- CHEST
|
||||
- TRAPPED_CHEST
|
||||
#<23><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,/pishow<6F>鿴<EFBFBD><E9BFB4>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>)
|
||||
# - 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
|
||||
Reference in New Issue
Block a user