Skip to content

Commit

Permalink
Remove getters and setters from Level.java.patch
Browse files Browse the repository at this point in the history
- These getters and setters are not needed, and just make extending Level in a multiloader mod annoying.
  • Loading branch information
IThundxr committed Dec 31, 2024
1 parent 8013de0 commit add4bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/net/minecraft/world/entity/player/Player.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
if (!this.isSleeping()) {
- this.awardStat(Stats.TIME_SINCE_REST);
+ float dayTimeFraction;
+
+
+ if (level().isClientSide) {
+ dayTimeFraction = ((net.minecraft.client.multiplayer.ClientLevel) level()).dayTimeFraction;
+ } else {
+ dayTimeFraction = ((ServerLevel) level()).getDayTimeFraction();
+ }
+
+
+ // Neo: Advance TIME_SINCE_REST if (a) vanilla daytime handling in effect, or (b) days are shorter, or (c) dayTime has ticked, or (d) dayTime advances are off and we need to ignore day length
+ if (dayTimeFraction < 0 || dayTimeFraction >= 1 || lastDayTimeTick != level().getDayTime() || !serverplayer.serverLevel().getGameRules().getRule(GameRules.RULE_DAYLIGHT).get()) {
+ lastDayTimeTick = level().getDayTime();
Expand Down

0 comments on commit add4bfb

Please sign in to comment.