-
Notifications
You must be signed in to change notification settings - Fork 9
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
5caf040
commit 0ace777
Showing
3 changed files
with
102 additions
and
70 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
31 changes: 31 additions & 0 deletions
31
src/main/java/net/modfest/fireblanket/mixin/ChangeHowSleepTimeWorks.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,31 @@ | ||
package net.modfest.fireblanket.mixin; | ||
|
||
import net.minecraft.registry.DynamicRegistryManager; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.profiler.Profiler; | ||
import net.minecraft.world.MutableWorldProperties; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.dimension.DimensionType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
|
||
import java.util.function.Supplier; | ||
|
||
@Mixin(ServerWorld.class) | ||
public abstract class ChangeHowSleepTimeWorks extends World { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
TheEpicBlock
Author
Member
|
||
protected ChangeHowSleepTimeWorks(MutableWorldProperties properties, RegistryKey<World> registryRef, DynamicRegistryManager registryManager, RegistryEntry<DimensionType> dimensionEntry, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates) { | ||
super(properties, registryRef, registryManager, dimensionEntry, profiler, isClient, debugWorld, biomeAccess, maxChainedNeighborUpdates); | ||
} | ||
|
||
// Hacked in fix for cerulean/moonrise compat | ||
@ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setTimeOfDay(J)V")) | ||
long changeSleep(long input) { | ||
if (this.isDay()) { | ||
return input - 24000L; | ||
} | ||
return input; | ||
} | ||
} |
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
why