Skip to content

Commit

Permalink
cerulean/moonrise interplay
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEpicBlock committed Feb 9, 2024
1 parent 5caf040 commit 0ace777
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 70 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.4+build.1
loader_version=0.15.1

# Mod Properties
mod_version=0.4.3
mod_version=0.4.4
maven_group=net.modfest
archives_base_name=fireblanket

Expand Down
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.

Copy link
@LemmaEOF

LemmaEOF Feb 9, 2024

Contributor

why

This comment has been minimized.

Copy link
@TheEpicBlock

TheEpicBlock Feb 9, 2024

Author Member

Don't question it. I needed some place to dump this random mixin. Not exactly in a position to do this properly right now :P

This comment has been minimized.

Copy link
@LemmaEOF

LemmaEOF Feb 9, 2024

Contributor

fair lmao

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;
}
}
139 changes: 70 additions & 69 deletions src/main/resources/fireblanket.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,79 @@
"compatibilityLevel": "JAVA_17",
"plugin": "net.modfest.fireblanket.FireblanketMixin",
"mixins": [
"accessor.BlockEntityTypeAccessor",
"accessor.ClientConnectionAccessor",
"accessor.EntityTypeAccessor",
"accessor.ServerChunkManagerAccessor",
"accessor.ServerLoginNetworkHandlerAccessor",
"adventure_fix.MixinEggItem",
"adventure_fix.MixinFlowerPotBlock",
"ai.MixinTemptGoal",
"be_sync.MixinBlockEntity",
"be_sync.MixinChunkHolder",
"block.MixinCommandBlock",
"block_format.MixinChunkSection",
"entity_ticking.MixinDebugStickItem",
"entity_ticking.MixinEntity",
"entity_ticking.MixinItemGroups",
"entity_ticking.MixinLivingEntity",
"entity_ticking.MixinMinecraftServer",
"entity_ticking.MixinThreadedAnvilChunkStorage",
"entity_ticking.create.MixinSuperGlueEntity",
"footgun.MixinEntitySelectorOptions",
"footgun.MixinEntitySelectorReader",
"fsc.MixinClientConnection",
"fsc.MixinSizePrepender",
"fsc.MixinSplitterHandler",
"io_uring.MixinServerNetworkIo",
"mods.create.AccessorSmartBlockEntity",
"mods.create.MixinMechanicalBearingBlockEntity",
"mods.mythicmetals.MixinCarmotShield",
"mods.pehkui.MixinScaleUtils",
"mods.pswg.MixinComplexCollisionManager",
"mods.terracotta_knights.MixinItemPickupGoal",
"opto.MixinEntitySelector",
"opto.MixinRecipeManager",
"packet_chunk_cache.MixinChunkDataS2CPacket",
"packet_chunk_cache.MixinWorldChunk",
"region_chunk_cache.MixinServerChunkManager",
"serde.MixinNbtCompound",
"serde.MixinServerPlayerEntity",
"sounds.MixinSpyglassItem",
"zstd.MixinChunkStreamVersion",
"zstd.MixinLevelStorageSession",
"zstd.MixinPersistentState",
"zstd.MixinPersistentStateManager",
"zstd.MixinRegionFile"
"ChangeHowSleepTimeWorks",
"accessor.BlockEntityTypeAccessor",
"accessor.ClientConnectionAccessor",
"accessor.EntityTypeAccessor",
"accessor.ServerChunkManagerAccessor",
"accessor.ServerLoginNetworkHandlerAccessor",
"adventure_fix.MixinEggItem",
"adventure_fix.MixinFlowerPotBlock",
"ai.MixinTemptGoal",
"be_sync.MixinBlockEntity",
"be_sync.MixinChunkHolder",
"block.MixinCommandBlock",
"block_format.MixinChunkSection",
"entity_ticking.MixinDebugStickItem",
"entity_ticking.MixinEntity",
"entity_ticking.MixinItemGroups",
"entity_ticking.MixinLivingEntity",
"entity_ticking.MixinMinecraftServer",
"entity_ticking.MixinThreadedAnvilChunkStorage",
"entity_ticking.create.MixinSuperGlueEntity",
"footgun.MixinEntitySelectorOptions",
"footgun.MixinEntitySelectorReader",
"fsc.MixinClientConnection",
"fsc.MixinSizePrepender",
"fsc.MixinSplitterHandler",
"io_uring.MixinServerNetworkIo",
"mods.create.AccessorSmartBlockEntity",
"mods.create.MixinMechanicalBearingBlockEntity",
"mods.mythicmetals.MixinCarmotShield",
"mods.pehkui.MixinScaleUtils",
"mods.pswg.MixinComplexCollisionManager",
"mods.terracotta_knights.MixinItemPickupGoal",
"opto.MixinEntitySelector",
"opto.MixinRecipeManager",
"packet_chunk_cache.MixinChunkDataS2CPacket",
"packet_chunk_cache.MixinWorldChunk",
"region_chunk_cache.MixinServerChunkManager",
"serde.MixinNbtCompound",
"serde.MixinServerPlayerEntity",
"sounds.MixinSpyglassItem",
"zstd.MixinChunkStreamVersion",
"zstd.MixinLevelStorageSession",
"zstd.MixinPersistentState",
"zstd.MixinPersistentStateManager",
"zstd.MixinRegionFile"
],
"injectors": {
"defaultRequire": 1
"defaultRequire": 1
},
"client": [
"accessor.ClientLoginNetworkHandlerAccessor",
"client.MixinClientPlayNetworkHandler",
"client.MixinRenderSystem",
"client.MixinSignBlockEntityRenderer",
"client.be_masking.MixinBlockEntityRenderDispatcher",
"client.be_masking.MixinRebuildTask",
"client.be_masking.sodium.MixinChunkRenderRebuildTask",
"client.bufferbuilder_opto.MixinBufferBuilder",
"client.bufferbuilder_opto.MixinVertexFormat",
"client.entity_masking.MixinEntityRenderer",
"client.entity_ticking.MixinArmorStandEntity",
"client.entity_ticking.MixinLivingEntity",
"client.hooks.MixinWorldRenderer",
"client.lambdamap.MixinMapRegionFile",
"client.render_regions.MixinBlockEntityRenderDispatcher",
"client.render_regions.MixinEntityRenderDispatcher",
"client.render_regions.MixinRegionSubjects",
"client.timing.MixinBlockEntityRenderDispatcher",
"client.timing.MixinClientWorld",
"client.timing.MixinEntityRenderer",
"client.timing.MixinObservables",
"client.timing.MixinWorld",
"client.vbo_opto.MixinShaderProgram",
"client.vbo_opto.MixinVertexBuffer"
"accessor.ClientLoginNetworkHandlerAccessor",
"client.MixinClientPlayNetworkHandler",
"client.MixinRenderSystem",
"client.MixinSignBlockEntityRenderer",
"client.be_masking.MixinBlockEntityRenderDispatcher",
"client.be_masking.MixinRebuildTask",
"client.be_masking.sodium.MixinChunkRenderRebuildTask",
"client.bufferbuilder_opto.MixinBufferBuilder",
"client.bufferbuilder_opto.MixinVertexFormat",
"client.entity_masking.MixinEntityRenderer",
"client.entity_ticking.MixinArmorStandEntity",
"client.entity_ticking.MixinLivingEntity",
"client.hooks.MixinWorldRenderer",
"client.lambdamap.MixinMapRegionFile",
"client.render_regions.MixinBlockEntityRenderDispatcher",
"client.render_regions.MixinEntityRenderDispatcher",
"client.render_regions.MixinRegionSubjects",
"client.timing.MixinBlockEntityRenderDispatcher",
"client.timing.MixinClientWorld",
"client.timing.MixinEntityRenderer",
"client.timing.MixinObservables",
"client.timing.MixinWorld",
"client.vbo_opto.MixinShaderProgram",
"client.vbo_opto.MixinVertexBuffer"
]
}

0 comments on commit 0ace777

Please sign in to comment.