Skip to content

Commit

Permalink
Fix few ChangeDataHolderEvent.ValueChange rejection values
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Oct 7, 2023
1 parent f04da27 commit 4053462
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public void sendMessage(final OutgoingChatMessage $$0, final boolean $$1, final

return (GameType) (Object) event.endResult().successfulValue(Keys.GAME_MODE)
.map(Value::get)
.orElse((GameMode) (Object) value);
.orElse((GameMode) (Object) this.gameMode.getGameModeForPlayer());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,10 @@ public void stopRiding() {
//If the event is cancelled, well, don't change the underlying value.
return;
}
this.remainingFireTicks = valueChange.endResult().successfulValue(Keys.FIRE_TICKS)
valueChange.endResult().successfulValue(Keys.FIRE_TICKS)
.map(Value::get)
.map(t -> (int) t.ticks())
.orElse(0);
.ifPresent(t -> this.remainingFireTicks = t);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ public abstract class FoodDataMixin implements FoodDataBridge {

return event.endResult().successfulValue(key)
.map(Value::get)
.orElse(value);
.orElse(currentValue);
}
}

0 comments on commit 4053462

Please sign in to comment.