You are not logged in.

  • Login

[Bukkit-Plugin] Fehler beim Cache speichern

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.

lolgamerHDTV

User / Kunde

  • "lolgamerHDTV" started this thread

Posts: 62

  • Send private message

1

Friday, February 1st 2019, 12:30am

Fehler beim Cache speichern

Hallihallo,

Ich habe eine Cache in einer Hashmap um booleans zwischen zu speichern. Nun versuche ich beim Crash oder Neustart die Cache in die File zu übertragen allerdings
scheint er die HashMap nicht zu finden.

Error:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[00:25:39] [Server thread/ERROR]: Error occurred while disabling System v1.0 (Is it up to date?)
java.lang.NullPointerException
	at de.jens98.utils.function.offlineSave(function.java:540) ~[?:?]
	at de.jens98.main.main.onDisable(main.java:139) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:323) ~[patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:360) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:427) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:420) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.plugin.SimplePluginManager.clearPlugins(SimplePluginManager.java:473) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:735) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.Bukkit.reload(Bukkit.java:556) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) [patched.jar:git-PaperSpigot-"4c7641d"]
	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:629) [patched.jar:git-PaperSpigot-"4c7641d"]
	at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:416) [patched.jar:git-PaperSpigot-"4c7641d"]
	at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:379) [patched.jar:git-PaperSpigot-"4c7641d"]
	at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"]
	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]



function:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
	public static void offlineSave() {

		if (!getLanguageFile().exists()) {
			return;
		}

		new YamlConfiguration();
		FileConfiguration sp = YamlConfiguration.loadConfiguration(getLanguageFile());

		/* ERROR */ boolean globalmute = function.getBooleans().get("Chat.Options.Globalmute");
		sp.set("Chat.Options.Globalmute", globalmute);

		try {
			sp.save(getLanguageFile());
		} catch (IOException e) {
			function.sendConsolenMessage(e.getMessage());
		}

	}



main:

Source code

1
2
3
4
5
6
7
	@Override
	public void onDisable() {
		function.offlineSave();
		if (mysql.isConnected()) {
			mysql.disconnect();
		}
	}




Hoffe jemand kann mir helfen, ein Weg zu finden das abzuspeichern.

This post has been edited 2 times, last edit by "lolgamerHDTV" (Feb 1st 2019, 12:36am)


xtrumb

User / Kunde

  • "xtrumb" is male

Posts: 2,295

Location: hier

Occupation: Fachinformatiker für Systemintegration

Thanks: 16

  • Send private message

2

Friday, February 1st 2019, 8:31am

boolean globalmute = function.getBooleans().get("Chat.Options.Globalmute");

In

boolean globalmute = function.getBoolean("Chat.Options.Globalmute");

Sollte das Problem beheben. Es ist auch immer interessant zu wissen, was du getan hast, damit es funktioniert.
Mit freundlichen Grüßen
TrueMB

Dienstleistungs Service
Unser Csgo Team

lolgamerHDTV

User / Kunde

  • "lolgamerHDTV" started this thread

Posts: 62

  • Send private message

3

Monday, February 4th 2019, 8:58pm

boolean globalmute = function.getBooleans().get("Chat.Options.Globalmute");

In

boolean globalmute = function.getBoolean("Chat.Options.Globalmute");

Sollte das Problem beheben. Es ist auch immer interessant zu wissen, was du getan hast, damit es funktioniert.



Nein das war nicht das Problem. function.getBooleans ist eine HashMap was du meinst wäre eine File. Ich habe einfach in der HashMap Globlmute geschrieben anstatt Globalmute.

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