Skip to content

Commit

Permalink
Modify luck and fix show_particles option not respected
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed May 24, 2024
1 parent 1e53f9f commit d8a3142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions origins/src/main/java/me/dueris/genesismc/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ public static PotionEffect parsePotionEffect(FactoryJsonObject effect) {
int duration = 100;
int amplifier = 0;
boolean isAmbient = false;
boolean showParticles = true;
boolean showParticles = false;
boolean showIcon = true;

if (effect.isPresent("effect")) potionEffect = effect.getString("effect");
if (effect.isPresent("duration")) duration = effect.getNumber("duration").getInt();
if (effect.isPresent("amplifier")) amplifier = effect.getNumber("amplifier").getInt();
if (effect.isPresent("is_ambient")) isAmbient = effect.getBooleanOrDefault("is_ambient", true);
if (effect.isPresent("show_particles")) effect.getBooleanOrDefault("show_particles", false);
if (effect.isPresent("show_particles")) showParticles = effect.getBooleanOrDefault("show_particles", false);
if (effect.isPresent("show_icon")) showIcon = effect.getBooleanOrDefault("show_icon", false);

return new PotionEffect(PotionEffectType.getByKey(NamespacedKey.fromString(potionEffect)), duration, amplifier, isAmbient, showParticles, showIcon);
Expand Down Expand Up @@ -826,7 +826,7 @@ private static int getPos(JsonReader jsonReader) {
throw new IllegalStateException("Couldn't read position of JsonReader", var2);
}
}

public static <T> T parseJson(com.mojang.brigadier.StringReader stringReader, Codec<T> codec) {
JsonReader jsonReader = new JsonReader(new java.io.StringReader(stringReader.getRemaining()));
jsonReader.setLenient(true);
Expand Down
14 changes: 4 additions & 10 deletions origins/src/main/resources/data/origins/powers/luck.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@
"effects": [
{
"effect": "minecraft:luck",
"amplifier": 2,
"duration": 40,
"is_ambient": false,
"show_particles": false
},
{
"effect": "minecraft:hero_of_the_village",
"amplifier": 1,
"duration": 40,
"is_ambient": false,
"show_particles": false
"is_ambient": true,
"show_particles": false,
"show_icon": true
}
],
"name": "Treasure Finder",
"description": "You have increased chances of getting treasure loot, and villagers will lower their prices for you",
"description": "You have increased chances of getting treasure loot",
"hidden": false
}

0 comments on commit d8a3142

Please sign in to comment.