Skip to content

Commit

Permalink
Merge pull request #21 from LittleBeasts/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
lkno0705 authored May 18, 2021
2 parents 0252f0b + e1bf09c commit b2a25df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: bump_version
uses: christian-draeger/increment-semantic-version@1.0.2
with:
current-version: '2.0.0-alpha1'
current-version: '2.0.1-alpha1'
version-fragment: 'bug'
- name: Upload Artifacts
run: mkdir builds && cp target/*.jar builds/calculationEngine-${{ steps.bump_version.outputs.next-version }}.jar
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/config/LootConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public class LootConfig {
public static final int dropCommon = 60;
public static final int dropRare = 35;
public static final int dropLegendary = 5;
public static final JSONObject itemList = readJson(LootConfig.class.getResource("/items.JSON").getPath());
public static final JSONObject itemList = readJson("/items.JSON");
}
13 changes: 9 additions & 4 deletions src/main/java/utilities/JsonReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
import org.json.JSONObject;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class JsonReader {

public static JSONObject readJson(String fileName) {
InputStream inputStream = JsonReader.class.getResourceAsStream(fileName);
StringBuilder sJson = new StringBuilder();
try (BufferedReader br = new BufferedReader(new FileReader(new File(fileName)))) {
String str;
while ((str = br.readLine()) != null) {
sJson.append(str).append("\n");
try {
assert inputStream != null;
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
String str;
while ((str = br.readLine()) != null) {
sJson.append(str).append("\n");
}
}
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit b2a25df

Please sign in to comment.