Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/dmillerw/lore/common/lore/LoreLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import org.apache.commons.io.FilenameUtils;

import java.io.File;
import java.io.FileReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.*;

/**
Expand Down Expand Up @@ -57,7 +58,8 @@ public int compare(Lore o1, Lore o2) {
}

public static void loadLore(File file) throws Exception {
Lore lore = JsonUtil.gson().fromJson(new FileReader(file), Lore.class);
Lore lore = JsonUtil.gson().fromJson(new InputStreamReader(
new FileInputStream(file), "UTF-8"), Lore.class);

if (!categories.contains(lore.category))
categories.add(lore.category);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static class Handler implements IMessageHandler<PacketNotification, IMess
@Override
public IMessage onMessage(PacketNotification message, MessageContext ctx) {
World clientWorld = LoreExpansion.proxy.getClientWorld();
if (clientWorld == null) {
if (clientWorld != null) {
if (message.type == TYPE_CLIENT_PICKUP || message.type == TYPE_CLIENT_AUTOPLAY) {
LoreExpansion.proxy.handleNotificationPacket(message, ctx);
}
Expand Down