Skip to content

Commit

Permalink
1.7.2: Resources and API fixes (#128)
Browse files Browse the repository at this point in the history
* New Bazaar API (#127)

* version bump

* Fix item names (#130)

---------

Co-authored-by: Detlev1 <[email protected]>
  • Loading branch information
symt and Detlev1 authored Mar 25, 2024
1 parent a0e1a0e commit 988b272
Show file tree
Hide file tree
Showing 4 changed files with 314 additions and 287 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "dev.meyi.bazaarnotifier"
version = "1.7.1"
version = "1.7.2"
val mod_id = "bazaarnotifier"

java {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/dev/meyi/bn/BazaarNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Objects;
Expand All @@ -42,7 +44,7 @@
public class BazaarNotifier {

public static final String MODID = "BazaarNotifier";
public static final String VERSION = "1.7.1";
public static final String VERSION = "1.7.2";
public static final String prefix =
EnumChatFormatting.GOLD + "[" + EnumChatFormatting.YELLOW + "BN" + EnumChatFormatting.GOLD
+ "] " + EnumChatFormatting.RESET;
Expand Down Expand Up @@ -98,7 +100,7 @@ public void preInit(FMLPreInitializationEvent event) {
byte[] bytes = Files.readAllBytes(Paths.get(resourcesFile.getPath()));
if (bytes.length == 0) throw new JsonSyntaxException("Invalid JSON in Resources File");
JsonReader resourcesReader = new JsonReader(new StringReader(new String(
bytes)));
bytes, StandardCharsets.UTF_8)));
resourcesReader.setLenient(true);
resources = gson.fromJson(resourcesReader, JsonObject.class);
} catch (JsonSyntaxException | ClassCastException e) {
Expand All @@ -120,7 +122,7 @@ public void preInit(FMLPreInitializationEvent event) {

try {
Utils.updateResources();
} catch (IOException e) {
} catch (IOException | KeyManagementException | NoSuchAlgorithmException e) {
System.err.println("Error while getting resources from GitHub");
e.printStackTrace();
JsonObject bazaarConversions = resources.getAsJsonObject("bazaarConversions");
Expand Down
Loading

0 comments on commit 988b272

Please sign in to comment.