Skip to content

Commit

Permalink
Fix a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 23, 2024
1 parent 14768a4 commit 615e535
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.15.11

# Mod Properties
mod_version = 1.0.0
mod_version = 1.0.1
maven_group = eu.pb4
archives_base_name = ouch

Expand Down
7 changes: 2 additions & 5 deletions src/main/java/eu/pb4/ouch/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ public static Config get() {
DeathDisplayLogic.CODEC.listOf().listOf().fieldOf("death").forGetter(Config::death)
).apply(instance, Config::new));

@Nullable
public void selectDamage(LivingEntity entity, DamageSource source, float amount, BiConsumer<Text, FloatingText.DisplaySettings> consumer) {
var predicateContext = PredicateContext.of(entity);
var attackerContext = source.getAttacker() != null ? PredicateContext.of(source.getAttacker()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
var sourceContext = source.getSource() != null ? PredicateContext.of(source.getAttacker()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
var sourceContext = source.getSource() != null ? PredicateContext.of(source.getSource()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
for (var a : this.damage) {
for (var e : a) {
if (e.match(entity, source, predicateContext, attackerContext, sourceContext)) {
Expand All @@ -39,11 +38,10 @@ public void selectDamage(LivingEntity entity, DamageSource source, float amount,
}
}

@Nullable
public void selectDeath(LivingEntity entity, DamageSource source, BiConsumer<Text, FloatingText.DisplaySettings> consumer) {
var predicateContext = PredicateContext.of(entity);
var attackerContext = source.getAttacker() != null ? PredicateContext.of(source.getAttacker()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
var sourceContext = source.getSource() != null ? PredicateContext.of(source.getAttacker()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
var sourceContext = source.getSource() != null ? PredicateContext.of(source.getSource()) : PredicateContext.of(Objects.requireNonNull(entity.getServer()));
for (var a : this.death) {
for (var e : a) {
if (e.match(entity, source, predicateContext, attackerContext, sourceContext)) {
Expand All @@ -55,7 +53,6 @@ public void selectDeath(LivingEntity entity, DamageSource source, BiConsumer<Tex

}

@Nullable
public void selectHealing(LivingEntity entity, float amount, BiConsumer<Text, FloatingText.DisplaySettings> consumer) {
var predicateContext = PredicateContext.of(entity);
for (var a : this.healing) {
Expand Down

0 comments on commit 615e535

Please sign in to comment.