Skip to content

Commit

Permalink
got basic issue screan working
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBlackburn1 committed Jun 8, 2024
1 parent a785740 commit db1e49d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ configurations {
}

group = 'starblazer.studios'
version = '1.0.0'
version = '1.0.2'

ext {
minecraft_version = '1.19.2'
Expand Down
37 changes: 18 additions & 19 deletions src/main/java/starblazerstudio/utils/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,34 +91,33 @@ public class GuiUtils {
public static int getBackgroundnum(Random random,int background, int backgroundCount){
int output = 0;
if(Consts.devMode){
output = 29;
output = background;
}
else{
output = random.nextInt(backgroundCount);
}
return output;
}


// loads data from json fiels
public static void loadFromJson(InputStream p_128109_,int background_count) {
Gson json = new Gson();
Random random = new Random();
JsonArray jsonobject = json.fromJson(new InputStreamReader(p_128109_, StandardCharsets.UTF_8), JsonArray.class);
int i = 0;
for(Entry<String, JsonElement> entry : jsonobject.get(getBackgroundnum(random,0,background_count)).getAsJsonObject().entrySet()) {
Consts.debug(entry.getKey().toString());
Consts.keys.add(entry.getKey().toString());
Consts.background.add(entry.getValue());
Consts.log("Linked list for keys"+ " "+ entry.getKey().toString()+ " "+ entry.getValue().toString());
Consts.log("Linked List for data"+ " "+ Consts.background.toString());
}
}
Gson json = new Gson();
Random random = new Random();

JsonArray jsonobject = json.fromJson(new InputStreamReader(p_128109_, StandardCharsets.UTF_8), JsonArray.class);
int i = 0;

for(Entry<String, JsonElement> entry : jsonobject.get(getBackgroundnum(random,28,background_count)).getAsJsonObject().entrySet()) {
Consts.debug(entry.getKey().toString());
Consts.keys.add(entry.getKey().toString());
Consts.background.add(entry.getValue());

Consts.log("Linked list for keys"+ " "+ entry.getKey().toString()+ " "+ entry.getValue().toString());
Consts.log("Linked List for data"+ " "+ Consts.background.toString());

}

}


// Dumps json so i cam then hope fully get daya from it
Expand Down

0 comments on commit db1e49d

Please sign in to comment.