Fix messages

This commit is contained in:
Daniel Saukel 2022-04-04 20:30:27 +02:00
parent 1240d4c2c5
commit ce0e1ed4f3
4 changed files with 20 additions and 6 deletions

View File

@ -24,6 +24,7 @@ import de.erethon.dungeonsxxl.util.GlowUtil;
*/ */
public class DungeonsXXL extends EPlugin implements DungeonModule { public class DungeonsXXL extends EPlugin implements DungeonModule {
private static DungeonsXXL instance;
private DungeonsXL dxl; private DungeonsXL dxl;
private GlowUtil glowUtil; private GlowUtil glowUtil;
@ -37,6 +38,7 @@ public class DungeonsXXL extends EPlugin implements DungeonModule {
@Override @Override
public void onEnable() { public void onEnable() {
instance = this;
dxl = DungeonsXL.getInstance(); dxl = DungeonsXL.getInstance();
glowUtil = new GlowUtil(this); glowUtil = new GlowUtil(this);
} }
@ -47,7 +49,7 @@ public class DungeonsXXL extends EPlugin implements DungeonModule {
* @return the instance of this plugin * @return the instance of this plugin
*/ */
public static DungeonsXXL getInstance() { public static DungeonsXXL getInstance() {
return (DungeonsXXL) EPlugin.getInstance(); return instance;
} }
/** /**

View File

@ -16,7 +16,10 @@
*/ */
package de.erethon.dungeonsxl.config; package de.erethon.dungeonsxl.config;
import de.erethon.bedrock.chat.MessageUtil;
import de.erethon.bedrock.config.Message; import de.erethon.bedrock.config.Message;
import de.erethon.bedrock.config.MessageHandler;
import de.erethon.dungeonsxl.DungeonsXL;
/** /**
* An enumeration of all messages. The values are fetched from the language file. * An enumeration of all messages. The values are fetched from the language file.
@ -253,4 +256,14 @@ public enum DMessage implements Message {
return path; return path;
} }
@Override
public MessageHandler getMessageHandler() {
return DungeonsXL.getInstance().getMessageHandler();
}
@Override
public void debug() {
MessageUtil.log(DungeonsXL.getInstance(), getMessage());
}
} }

View File

@ -19,12 +19,11 @@ package de.erethon.dungeonsxl.player;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import de.erethon.bedrock.chat.MessageUtil; import de.erethon.bedrock.chat.MessageUtil;
import de.erethon.bedrock.compatibility.Internals;
import de.erethon.bedrock.compatibility.Version; import de.erethon.bedrock.compatibility.Version;
import de.erethon.bedrock.config.ConfigUtil; import de.erethon.bedrock.config.ConfigUtil;
import de.erethon.bedrock.config.EConfig; import de.erethon.bedrock.config.EConfig;
import de.erethon.bedrock.plugin.EPlugin;
import de.erethon.bedrock.misc.EnumUtil; import de.erethon.bedrock.misc.EnumUtil;
import de.erethon.dungeonsxl.DungeonsXL;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -484,7 +483,7 @@ public class DPlayerData extends EConfig {
if (!file.exists()) { if (!file.exists()) {
try { try {
file.createNewFile(); file.createNewFile();
MessageUtil.log(EPlugin.getInstance(), "&6A new player data file has been created and saved as " + file.getName()); MessageUtil.log(DungeonsXL.getInstance(), "&6A new player data file has been created and saved as " + file.getName());
} catch (IOException exception) { } catch (IOException exception) {
} }
} }

View File

@ -27,13 +27,13 @@
<dependency> <dependency>
<groupId>de.erethon.caliburn</groupId> <groupId>de.erethon.caliburn</groupId>
<artifactId>caliburn-api</artifactId> <artifactId>caliburn-api</artifactId>
<version>1.1-SNAPSHOT</version> <version>1.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>de.erethon.caliburn</groupId> <groupId>de.erethon.caliburn</groupId>
<artifactId>calicomp</artifactId> <artifactId>calicomp</artifactId>
<version>1.1-SNAPSHOT</version> <version>1.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>