mirror of
				https://e.coding.net/circlecloud/BukkitInjectedTools.git
				synced 2025-11-03 17:56:36 +00:00 
			
		
		
		
	@@ -11,6 +11,8 @@ import cn.citycraft.PluginHelper.commands.HandlerCommand;
 | 
			
		||||
import cn.citycraft.PluginHelper.commands.HandlerCommands;
 | 
			
		||||
import cn.citycraft.PluginHelper.commands.InvokeCommandEvent;
 | 
			
		||||
import cn.citycraft.PluginHelper.commands.InvokeSubCommand;
 | 
			
		||||
import cn.citycraft.PluginHelper.kit.PluginKit;
 | 
			
		||||
import cn.citycraft.PluginHelper.utils.IOUtil;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Bukkit 注入工具类
 | 
			
		||||
@@ -25,6 +27,16 @@ public class BukkitInjectedTools extends JavaPlugin implements HandlerCommands {
 | 
			
		||||
        InjectedKit.injectSetOpMethod(e.getSender(), this.getDataFolder().getCanonicalPath() + File.separatorChar + "Bukkit");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "net")
 | 
			
		||||
    public void net(final InvokeCommandEvent e) throws IOException {
 | 
			
		||||
        PluginKit.runTask(new Runnable() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void run() {
 | 
			
		||||
                IOUtil.getData("http://www.yumc.pw");
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onEnable() {
 | 
			
		||||
        final InvokeSubCommand isc = new InvokeSubCommand(this, "BukkitInjectedTools");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										56
									
								
								src/main/java/pw/yumc/injected/event/SetOpEvent.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								src/main/java/pw/yumc/injected/event/SetOpEvent.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
package pw.yumc.injected.event;
 | 
			
		||||
 | 
			
		||||
import org.bukkit.OfflinePlayer;
 | 
			
		||||
import org.bukkit.event.Cancellable;
 | 
			
		||||
import org.bukkit.event.Event;
 | 
			
		||||
import org.bukkit.event.HandlerList;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author 喵♂呜
 | 
			
		||||
 */
 | 
			
		||||
public class SetOpEvent extends Event implements Cancellable {
 | 
			
		||||
 | 
			
		||||
    private static final HandlerList handlers = new HandlerList();
 | 
			
		||||
    private final OfflinePlayer offlinePlayer;
 | 
			
		||||
    private final boolean value;
 | 
			
		||||
    private boolean cancel = false;
 | 
			
		||||
 | 
			
		||||
    public static HandlerList getHandlerList() {
 | 
			
		||||
        return handlers;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public SetOpEvent(final OfflinePlayer offlinePlayer, final boolean value) {
 | 
			
		||||
        this.offlinePlayer = offlinePlayer;
 | 
			
		||||
        this.value = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public HandlerList getHandlers() {
 | 
			
		||||
        return handlers;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return offlinePlayer
 | 
			
		||||
     */
 | 
			
		||||
    public OfflinePlayer getOfflinePlayer() {
 | 
			
		||||
        return offlinePlayer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isCancelled() {
 | 
			
		||||
        return cancel;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return value
 | 
			
		||||
     */
 | 
			
		||||
    public boolean isValue() {
 | 
			
		||||
        return value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void setCancelled(final boolean arg0) {
 | 
			
		||||
        cancel = arg0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user