Hey Leute ich habe ein Problem und zwar habe ich ein Plugin gemacht womit man Werbung auf Schilder machen kann aber ich habe folgenden Error.
Error
Code
[20:33:14] [Server thread/INFO]: Plugin is on verion:1.0
[20:33:14] [Server thread/INFO]: [Build] Enabling Build v1.0
[20:33:14] [Server thread/ERROR]: Error occurred while enabling Build v1.0 (Is it up to date?)
java.lang.IllegalArgumentException: Name cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getWorld(CraftServer.java:1014) ~[craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.Bukkit.getWorld(Bukkit.java:496) ~[craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at me.build.blaizerado.build.startSign(build.java:204) ~[?:?]
at me.build.blaizerado.build.onEnable(build.java:38) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [craftbukkit.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
Alles anzeigen
Code
Java
package me.build.blaizerado;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
public class build extends JavaPlugin implements Listener{
HashMap<String, ItemStack[]> inventory = new HashMap<>();
int high = 11;
int countdown;
int time = 30;
String tag = getConfig().getString("Config.tag");
@Override
public void onDisable() {
System.out.println("Penis");
super.onDisable();
}
public Inventory inv = null;
@Override
public void onEnable() {
startSign();
registerEvents();
lcomand();
loadConfig();
this.getServer().getPluginManager().registerEvents(this, this);
System.out.println("§4Plugin is On");
super.onEnable();
}
@SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender sender, Command cmd, String cmdlabel, String[] args) {
Player p = (Player) sender;
if(cmd.getName().equalsIgnoreCase("info")) {
if(p.hasPermission("build.info")) {
p.sendMessage("§4Build:");
p.sendMessage("§2Version: 1.0");
p.setHealth(20);
p.setFoodLevel(20);
p.sendMessage( tag + "Dein Leben & Essen wurden auf 20 gesetzt");
return true;
}
}
if(cmd.getName().equalsIgnoreCase("clear")) {
if(p.hasPermission("build.clear")) {
p.getInventory().clear();
p.sendMessage(tag + "Du hast dein Inventory Gecleart");
return true;
}
}
if(cmd.getName().equalsIgnoreCase("medien")) {
if(args.length == 0) {
p.sendMessage(tag + "Benutze: /medien youtube|ts3");
return true;
}
if(args.length == 1) {
if(p.hasPermission("build.media")) {
if(args[0].equalsIgnoreCase("youtube")) {
p.sendMessage(tag + "youtube/blaizerado");
return true;
}
if(args[0].equalsIgnoreCase("ts")) {
p.sendMessage(tag + "Ts3 ip: ts.Blaiz-Tay.net");
return true;
}else {
p.sendMessage(tag + "Benutze: /medien youtube|ts3");
return true;
}
}
}else {
p.sendMessage(tag + "Benutze: /medien youtube|ts3");
return true;
}
}
if(cmd.getName().equalsIgnoreCase("inv")) {
if(args.length==0) {
p.sendMessage( tag + "Benutze: /inv weg|wieder");
}
if(args.length == 1) {
if(p.hasPermission("build.inv")) {
if(args[0].equalsIgnoreCase("weg")) {
p.sendMessage( tag + "Du hast dein Inventar verstaut.");
inventory.put(p.getName(), p.getInventory().getContents());
p.getInventory().clear();
return true;
}
if(args[0].equalsIgnoreCase("wieder")) {
p.sendMessage(tag + "Du hast dein Inventar wieder hervor gehollt.");
ItemStack[] contents = inventory.get(p.getName());
p.getInventory().setContents(contents);
return true;
}
}
}
}
if(cmd.getName().equalsIgnoreCase("back")) {
final Location loc = p.getLocation();
p.sendMessage(tag + "In 5 Sekunden gehts back.");
if(p.hasPermission("build.back")) {
Bukkit.getScheduler().scheduleAsyncDelayedTask(this, new Runnable() {
@Override
public void run() {
p.teleport(loc);
p.sendMessage("§2[Build]§6 Willkommen back XD.");
}
}, 20*5);
return true;
}
}
if(cmd.getName().equalsIgnoreCase("gmevent")) {
if(p.hasPermission("build.gmevemt")) {
p.sendMessage(tag + " Du hast den Countdown gestartet");
countdown = Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
if(high != 0) {
high--;
p.sendMessage(tag + "Zeit:" + high +"§6 Sekunden");
p.setLevel(high);
}else {
p.sendMessage(tag + "Dein Gamemode wurde geandert");
p.setGameMode(GameMode.CREATIVE);
Bukkit.getScheduler().cancelTask(countdown);
int herz = getConfig().getInt("Config.lives");
p.setHealth(herz);
}
}
}, 0, 20);
}
}
return false;
}
public void loadConfig() {
getConfig().options().copyDefaults(true);
saveConfig();
}
public void registerEvents() {
new joinlist(this);
new onLeav(this);
new OnKick(this);
new ArrowExplode(this);
new InteractivListener(this);
new iteminvlistener(this);
}
public void lcomand() {
healcommand chealcommand = new healcommand(this);
getCommand("heal").setExecutor(chealcommand);
Item cItem = new Item(this);
getCommand("item").setExecutor(cItem);
CreatSpawn cCreatSpawn = new CreatSpawn(this);
getCommand("mob").setExecutor(cCreatSpawn);
FireworkCommand cFireworkCommand = new FireworkCommand(this);
getCommand("firework").setExecutor(cFireworkCommand);
Teleportcommand cTeleportcommand = new Teleportcommand(this);
getCommand("teleport").setExecutor(cTeleportcommand);
homecmd chomecmd = new homecmd(this);
getCommand("sethome").setExecutor(chomecmd);
mchomecmd cmchomecmd = new mchomecmd(this);
getCommand("home").setExecutor(cmchomecmd);
gmcommand gmcommand = new gmcommand(this);
getCommand("gm").setExecutor(gmcommand);
signcmd csigncmd = new signcmd(this);
getCommand("gm").setExecutor(csigncmd);
}
public void startSign() {
String world = this.getConfig().getString("Sign.world");
double x = this.getConfig().getDouble("Sign.x");
double y = this.getConfig().getDouble("Sign.y");
double z = this.getConfig().getDouble("Sign.z");
Location loc = new Location(Bukkit.getWorld(world),x,y,z);
Block b = loc.getBlock();
if(b.getState() instanceof Sign) {
final Sign s = (Sign) b.getState();
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
if(time != 0) {
time --;
}
if(time ==29) {
s.setLine(1,"Ts:Blaiz-tay.net");
s.update();
}
if(time ==28) {
s.setLine(1," Blaiz-tay.net");
s.update();
}
if(time ==27) {
s.setLine(1," Willkommen");
s.setLine(2," auf");
s.setLine(3," Blaiz-tay.net");
s.update();
}
if(time ==26) {
s.setLine(1," Willkommen");
s.setLine(2," auf");
s.setLine(3," Blaiz-tay.net");
s.update();
}
if(time ==25) {
s.setLine(1," Willkommen");
s.setLine(2," auf");
s.setLine(3," Blaiz-tay.net");
s.update();
}
if(time ==24) {
s.setLine(1," Wir wünschen");
s.setLine(2," euch");
s.setLine(3," Viel Spass");
s.update();
}
if(time ==23) {
s.setLine(1," Wir wünschen");
s.setLine(2," euch");
s.setLine(3," Viel Spass");
s.update();
}
if(time ==22) {
s.setLine(1," Wir wünschen");
s.setLine(2," euch");
s.setLine(3," Viel Spass");
s.update();
}
if(time ==21) {
s.setLine(1," Wir wünschen");
s.setLine(2," euch");
s.setLine(3," Viel Spass");
s.update();
}
if(time ==20) {
s.setLine(1, " Kein VIP !");
s.update();
time = 30;
}
}
}, 8, 8);
}
}
}
Alles anzeigen