@@ -54,16 +54,19 @@ public ServerPlayerMixins(Level level, GameProfile gameProfile) {
5454 @ Inject (method = "tick" , at = @ At (value = "HEAD" ))
5555 private void backroomsTick (CallbackInfo ci ) {
5656 boolean fullyImmersed = this .level ().getGameRules ().get (BackroomsGameRules .FULL_IMMERSION );
57- ResourceKey <Level > levelKey = this .level ().dimension ();
5857
59- boolean canNoclip = !this .lookingForNoclip && this .tickCount >= this .lastNoclipTick + Noclippable .NOCLIP_TICKS && !this .getAbilities ().invulnerable ;
58+ if (fullyImmersed ) {
59+ ResourceKey <Level > levelKey = this .level ().dimension ();
60+
61+ boolean canNoclip = !this .lookingForNoclip && this .tickCount >= this .lastNoclipTick + Noclippable .NOCLIP_TICKS && !this .getAbilities ().invulnerable ;
6062
61- if (levelKey == BackroomsLevels .LEVEL_0 && fullyImmersed ) {
62- this .tickDarkness ();
63- this .tickFood ();
64- } else if (levelKey == Level .OVERWORLD && fullyImmersed && canNoclip ) {
65- this .lookingForNoclip = true ;
66- this .tickNoclip ();
63+ this .tickFood (levelKey );
64+ if (levelKey == BackroomsLevels .LEVEL_0 ) {
65+ this .tickDarkness ();
66+ } else if (levelKey == Level .OVERWORLD && canNoclip ) {
67+ this .lookingForNoclip = true ;
68+ this .tickNoclip ();
69+ }
6770 }
6871 }
6972
@@ -148,8 +151,10 @@ private int getDarknessDuration() {
148151 }
149152
150153 @ Unique
151- private void tickFood () {
152- this .foodData .setFoodLevel (20 );
154+ private void tickFood (ResourceKey <Level > dimension ) {
155+ if (BackroomsLevels .isBackrooms (dimension )) {
156+ this .foodData .setFoodLevel (20 );
157+ }
153158 }
154159
155160 @ Inject (method = "stopSleepInBed" , at = @ At (value = "HEAD" ))
0 commit comments