Initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package de.craftix.essentials.commands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class EcCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
|
||||
if (sender instanceof Player){
|
||||
if (!sender.hasPermission("essentials.ec")) return true;
|
||||
Player p = (Player)sender;
|
||||
if (args.length == 0){
|
||||
p.openInventory(p.getEnderChest());
|
||||
}else if (args.length == 1){
|
||||
Player t = Bukkit.getPlayer(args[0]);
|
||||
if (t == null) return true;
|
||||
p.openInventory(t.getEnderChest());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package de.craftix.essentials.commands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class InvseeCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
|
||||
if (sender instanceof Player){
|
||||
if (!sender.hasPermission("essentials.invsee")) return true;
|
||||
Player p = (Player)sender;
|
||||
if (args.length == 1){
|
||||
Player t = Bukkit.getPlayer(args[0]);
|
||||
if (t == null) return true;
|
||||
if (t.getName().equals(p.getName())) return true;
|
||||
p.openInventory(t.getInventory());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package de.craftix.essentials.general;
|
||||
|
||||
import de.craftix.essentials.commands.EcCommand;
|
||||
import de.craftix.essentials.commands.InvseeCommand;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getCommand("ec").setExecutor(new EcCommand());
|
||||
getCommand("invsee").setExecutor(new InvseeCommand());
|
||||
}
|
||||
}
|
||||
8
Plugins/Old/Essentials/src/plugin.yml
Normal file
8
Plugins/Old/Essentials/src/plugin.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
name: Essentials
|
||||
api-version: 1.15
|
||||
version: 1.15.2
|
||||
main: de.craftix.essentials.general.Main
|
||||
|
||||
commands:
|
||||
ec:
|
||||
invsee:
|
||||
Reference in New Issue
Block a user