You are not logged in.

  • Login
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.

Caipi

User / Kunde

  • "Caipi" is male
  • "Caipi" started this thread

Posts: 22

Location: localhost

Occupation: Schüler

  • Send private message

1

Tuesday, July 3rd 2018, 7:40pm

Schnelles Signssystem durch Java

Hey guys!

Ich hab mich gefragt, ob ich ein Schildersystem, auch ohne Nutzung von SQL machen könnte, weil das ziemlich auf die Ressourcen schlägt. Also warum nicht die motd aus den properties der Server auslesen hab ich mir gedacht. Hier mein "tree":


-home
---lobby
-----plugins
-------"Signsystem.jar"
---build
-----server.properties

Und mein Code dazu:

Source code

1
File file = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath() + "/../../" + e.getLine(2) + "/server.properties");



Source code

1
[19:38:09 WARN]: java.io.FileNotFoundException: /home/lobby/plugins/SignSystem.jar/../../build/server.properties (Not a directory)[19:38:09 WARN]:        at java.io.FileInputStream.open0(Native Method)[19:38:09 WARN]:        at java.io.FileInputStream.open(FileInputStream.java:195)[19:38:09 WARN]:        at java.io.FileInputStream.<init>(FileInputStream.java:138)[19:38:09 WARN]:        at java.io.FileReader.<init>(FileReader.java:72)[19:38:09 WARN]:        at me.de.caipi.listener.SignCreator.oncreate(SignCreator.java:43)[19:38:09 WARN]:        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[19:38:09 WARN]:        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[19:38:09 WARN]:        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[19:38:09 WARN]:        at java.lang.reflect.Method.invoke(Method.java:498)[19:38:09 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)[19:38:09 WARN]:        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)[19:38:09 WARN]:        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500)[19:38:09 WARN]:        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:2134)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInUpdateSign.a(SourceFile:44)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInUpdateSign.a(SourceFile:10)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)[19:38:09 WARN]:        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[19:38:09 WARN]:        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)[19:38:09 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)[19:38:09 WARN]:        at java.lang.Thread.run(Thread.java:748)


Lieder meint er in der Console, dass das keine Directory sei... Einer eine Idee?

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