From 1ca41f88d7729d9279df71cd186ff86f22e7d515 Mon Sep 17 00:00:00 2001 From: Roman / Nea Date: Fri, 6 May 2022 16:13:36 +0200 Subject: Item Shop Recipes (#118) * first draft of item shop PR * add teleporter navigation because i can * fix teleporter navigation because apparently i cant * navigation gui basics * :pushpin: and removed some unused shit and added myself to devtest command * track / untrack + ery texture Co-Authored-By: RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> * consoom the event * fix crash in ItemShopRecipe.java + fetch repository * i am so sorry jani * on second thought, this entire thing was a bit untested * more recipe stuff * make navigation actually good * make pins dissapear if you not a waypoint * npc parsing * save file * different file saving * remove message * Warping... (to deez nuts) * move shit around Co-authored-by: jani270 Co-authored-by: RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> Co-authored-by: Lulonaut --- .../moulberry/notenoughupdates/util/Constants.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java index dab4844d..4c421f3e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java @@ -1,6 +1,17 @@ package io.github.moulberry.notenoughupdates.util; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.lang.reflect.Type; import java.util.concurrent.locks.ReentrantLock; @@ -42,7 +53,8 @@ public class Constants { private static final ReentrantLock lock = new ReentrantLock(); - public static void reload() { + @SubscribeEvent + public void reload(RepositoryReloadEvent event) { try { lock.lock(); @@ -57,6 +69,8 @@ public class Constants { ESSENCECOSTS = Utils.getConstant("essencecosts", gson); FAIRYSOULS = Utils.getConstant("fairy_souls", gson); REFORGESTONES = Utils.getConstant("reforgestones", gson); + } catch (Exception ex) { + ex.printStackTrace(); } finally { lock.unlock(); } -- cgit