-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e614ad
commit 8bceea3
Showing
6 changed files
with
35 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/main/java/com/nomiceu/nomilabs/mixin/DerivedWorldInfoMixin.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/main/java/com/nomiceu/nomilabs/mixin/WorldServerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.nomiceu.nomilabs.mixin; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.world.WorldServer; | ||
|
||
import org.spongepowered.asm.mixin.Final; | ||
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.Redirect; | ||
import org.spongepowered.asm.mixin.injection.Slice; | ||
|
||
/** | ||
* Makes Beds Change Time in All Dimensions. (Required for actually changing the time) | ||
*/ | ||
@Mixin(WorldServer.class) | ||
public class WorldServerMixin { | ||
|
||
@Shadow | ||
@Final | ||
private MinecraftServer server; | ||
|
||
@Redirect(method = "tick", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldServer;setWorldTime(J)V"), | ||
slice = @Slice(from = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/world/WorldServer;areAllPlayersAsleep()Z"), | ||
to = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldServer;wakeAllPlayers()V")), | ||
require = 1) | ||
private void changeTimeInAllDimensions(WorldServer instance, long time) { | ||
for (var world : server.worlds) { | ||
world.setWorldTime(time); | ||
} | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/com/nomiceu/nomilabs/mixinhelper/AccessibleDerivedWorldInfo.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters