Skip to content

Commit

Permalink
Fix Beds Not Changing Weather
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Aug 16, 2024
1 parent e464afc commit 224b3f5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/com/nomiceu/nomilabs/mixin/WorldServerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
* Makes Beds Change Time in All Dimensions. (Required for actually changing the time)
* Makes Beds Change Time and Weather in All Dimensions.
* <p>
* Makes Beds work in Void Dim.
*/
@Mixin(WorldServer.class)
public class WorldServerMixin {
Expand All @@ -31,4 +35,11 @@ private void changeTimeInAllDimensions(WorldServer instance, long time) {
world.setWorldTime(time);
}
}

@Inject(method = "resetRainAndThunder", at = @At("HEAD"))
private void resetWeatherInAllDimensions(CallbackInfo ci) {
for (var world : server.worlds) {
world.provider.resetRainAndThunder();
}
}
}

0 comments on commit 224b3f5

Please sign in to comment.