Skip to content

Commit

Permalink
Add mace damage indicator, fix fallback indicator not showing in defa…
Browse files Browse the repository at this point in the history
…ult config
  • Loading branch information
Patbox committed Dec 12, 2024
1 parent b260d0d commit dae7657
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.4-rc3
yarn_mappings=1.21.4-rc3+build.1
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
loader_version=0.16.9

# Mod Properties
mod_version = 1.3.0
mod_version = 1.3.1
maven_group = eu.pb4
archives_base_name = ouch

Expand Down
10 changes: 6 additions & 4 deletions preset/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[
{
"max_value": -1.0E-4,
"text": "<#ff0000>+${value} </><gray>¯\\\\_(ツ)_/¯",
"type": []
"text": "<#ff0000>+${value} </><gray>¯\\\\_(ツ)_/¯"
},
{
"text": "<#ff0000>-${value}</><yellow>☀",
Expand Down Expand Up @@ -58,6 +57,10 @@
"text": "<#ff0000>-${value}</><yellow>△",
"type": "minecraft:thorns"
},
{
"text": "<#ff0000>-${value}</><blue>🔨",
"type": "minecraft:mace_smash"
},
{
"text": "<#ff0000>-${value}</><light_gray>🗡",
"type": [
Expand Down Expand Up @@ -128,8 +131,7 @@
"type": "#minecraft:is_lightning"
},
{
"text": "<#ff0000>-${value}</>",
"type": []
"text": "<#ff0000>-${value}</>"
}
]
],
Expand Down
3 changes: 1 addition & 2 deletions preset/minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"damage": [
[
{
"text": "<#ff0000>-${value}</>",
"type": []
"text": "<#ff0000>-${value}</>"
}
]
],
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/pb4/ouch/DamageDisplayLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public record DamageDisplayLogic(Optional<RegistryEntryList<DamageType>> type,

public static DamageDisplayLogic of(RegistryWrapper.WrapperLookup wrapper, String format, FloatRange range, float chance, MinecraftPredicate victimPredicate, MinecraftPredicate sourcePredicate, MinecraftPredicate attackerPredicate, RegistryKey<DamageType>... type) {
var x = wrapper.getOrThrow(RegistryKeys.DAMAGE_TYPE);
return new DamageDisplayLogic(Optional.of(RegistryEntryList.of(Arrays.stream(type).map(x::getOrThrow).toList())),
return new DamageDisplayLogic(type.length == 0 ? Optional.empty() : Optional.of(RegistryEntryList.of(Arrays.stream(type).map(x::getOrThrow).toList())),
victimPredicate,
attackerPredicate,
sourcePredicate,
Expand Down
1 change: 1 addition & 0 deletions src/main/java/eu/pb4/ouch/Presets.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static BuilderImpl createDefault(BuilderImpl builder) {
builder.addDamage("<#ff0000>-${value}</><white>☄", DamageTypes.SPIT);
builder.addDamage("<#ff0000>-${value}</><yellow>▽", DamageTypes.STING);
builder.addDamage("<#ff0000>-${value}</><yellow>△", DamageTypes.THORNS);
builder.addDamage("<#ff0000>-${value}</><blue>\uD83D\uDD28", DamageTypes.MACE_SMASH);

builder.addDamage("<#ff0000>-${value}</><light_gray>\uD83D\uDDE1", DamageTypes.MOB_ATTACK, DamageTypes.PLAYER_ATTACK, DamageTypes.MOB_ATTACK_NO_AGGRO);
builder.addDamage("<#ff0000>-${value}</><yellow>⚠", DamageTypes.OUT_OF_WORLD, DamageTypes.OUTSIDE_BORDER);
Expand Down

0 comments on commit dae7657

Please sign in to comment.