You are not logged in.

  • Login

[Bukkit-Plugin] Plugin.yml fehler

Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

Dear visitor, welcome to Nitrado.net Prepaid Gameserver Community-Support - Archiv. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

MarcSenpai

User / Kunde

  • "MarcSenpai" is male
  • "MarcSenpai" started this thread

Posts: 138

Location: Clover

Occupation: Schüler

  • Send private message

1

Saturday, June 23rd 2018, 5:34pm

Plugin.yml fehler

Plugin.yml Fehler
Also..., ich versuche so in die Art Autoupdater damit zu gehen.
Dazu habe ich folgenden Code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package me.marc.senpai.autoupdater.main;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.commons.io.IOUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener{

	public String version = "1";
	public String versionlink = "https://test-uni-chat.000webhostapp.com/1/";
	public String downloadlink = "https://test-uni-chat.000webhostapp.com/autoupdater.jar/";
	public String newversion;
	
	
	public void onEnable() {
		
		Bukkit.getServer().getPluginManager().registerEvents(this, this);
		
		try {
			checkversion(new URL(versionlink));
		} catch (MalformedURLException e) {	
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		if(newversion.contains(version)) {
			
			
		}else
			Bukkit.getConsoleSender().sendMessage("§6Der Autoupdater läd jetzt das Update herunter");
		File file = new File("plugins/autoupdater.jar");
		if (!file.exists()) {
			Bukkit.getConsoleSender().sendMessage("§cBitte bennene den Autoupdater wieder in autoupdater um");
			Bukkit.shutdown();
		}else
		downloadFile(file, downloadlink);
	
	}
	
	public void onDisable() {
		
	
		
	}
	public static void downloadFile(File destination, String url)
	  {
		try
		{
	  	HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection();
	  	connection.connect();
	  	
	  	FileOutputStream outputStream = new FileOutputStream(destination);
	  	InputStream inputStream = connection.getInputStream();
	  	byte[] buffer = new byte['E'];
	  	int readBytes = 0;
	  	while ((readBytes = inputStream.read(buffer)) > 0) {
	    	outputStream.write(buffer, 0, readBytes);
	  	}
	  	outputStream.close();
	  	inputStream.close();
	  	connection.disconnect();
		}
		catch (Exception localException) {}
	  }
	
	public void checkversion(URL url) throws IOException {
		BufferedReader reader = null;
		StringBuilder builder = new StringBuilder(128000);
		
		try {
			reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
			int zahl;
			char[]data = new char[5000];
			while((zahl = reader.read(data)) != -1) {
				builder.append(data, 0, zahl);
			}
		}finally {
			IOUtils.closeQuietly(reader);
		}
		newversion = builder.toString();
	}
	
	 
	
	@EventHandler
	public void on(AsyncPlayerChatEvent e) {
		Player p = e.getPlayer();
		String msg = e.getMessage();
		
		if(msg.startsWith("test")) {
			p.sendMessage("§6Du bist bei: §l§6Vor");
		}
		
		
	}
	
	
	
	
	
	
}
Der Soweit ungetestet ist weil der Server diese Fehlermeldung ausgibt:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Could not load 'plugins\autoupdater.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    	at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:306) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.reload(CraftServer.java:751) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.Bukkit.reload(Bukkit.java:525) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:649) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:635) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:444) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:407) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	at java.lang.Thread.run(Unknown Source) [?:1.8.0_171]
Caused by: java.util.zip.ZipException: zip file is empty
    	at java.util.zip.ZipFile.open(Native Method) ~[?:1.8.0_171]
    	at java.util.zip.ZipFile.<init>(Unknown Source) ~[?:1.8.0_171]
    	at java.util.zip.ZipFile.<init>(Unknown Source) ~[?:1.8.0_171]
    	at java.util.jar.JarFile.<init>(Unknown Source) ~[?:1.8.0_171]
    	at java.util.jar.JarFile.<init>(Unknown Source) ~[?:1.8.0_171]
    	at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:148) ~[spigot-1.12.2.jar:git-Spigot-3d850ec-809c399]
    	... 13 more
Ich habe sie auch verstanden, finde den Fehler aber nicht,

Source code

1
2
3
4
5
6
name: AutoUpdater
version: 0.2
author: MarcSenpai
main: me.marc.senpai.autoupdater.main.Main

commands:
bedanken mich schonmal im vorraus :vain:
MfG Marc :thumbsup:
In der kürze liegt die Würze
- Shakespeares | Unitygaming-FastFelix

MarcSenpai

User / Kunde

  • "MarcSenpai" is male
  • "MarcSenpai" started this thread

Posts: 138

Location: Clover

Occupation: Schüler

  • Send private message

2

Monday, June 25th 2018, 2:32pm

#push
In der kürze liegt die Würze
- Shakespeares | Unitygaming-FastFelix

MarcSenpai

User / Kunde

  • "MarcSenpai" is male
  • "MarcSenpai" started this thread

Posts: 138

Location: Clover

Occupation: Schüler

  • Send private message

3

Tuesday, June 26th 2018, 8:57pm

Habe das Problem selbst gefunden xD
In der kürze liegt die Würze
- Shakespeares | Unitygaming-FastFelix

xtrumb

User / Kunde

  • "xtrumb" is male

Posts: 2,295

Location: hier

Occupation: Fachinformatiker für Systemintegration

Thanks: 16

  • Send private message

4

Wednesday, June 27th 2018, 8:10am

Lass mich raten, das / am Ende des Links? :D
Mit freundlichen Grüßen
TrueMB

Dienstleistungs Service
Unser Csgo Team

Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net