Skip to content

Commit

Permalink
refactor: move from accessor to access transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
leumasme committed Sep 1, 2024
1 parent ae15db4 commit eb80e93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
3 changes: 0 additions & 3 deletions src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,6 @@ public enum Mixins {
.setApplyIf(() -> FixesConfig.fixCandycraftBlockSugarNPE).addTargetedMod(TargetedMod.CANDYCRAFT)),

// Morpheus
FIX_NOT_WAKING_PLAYERS_ACCESSOR(new Builder("WorldServer Accessor for Morpheus waking fix")
.addMixinClasses("minecraft.WorldServerAccessor").setPhase(Phase.EARLY).setSide(Side.SERVER)
.setApplyIf(() -> FixesConfig.fixMorpheusWaking).addTargetedMod(TargetedMod.VANILLA)),
FIX_NOT_WAKING_PLAYERS(new Builder("Fix players not being woken properly when not everyone is sleeping")
.addMixinClasses("morpheus.MixinMorpheusWakePlayers").setPhase(Phase.LATE).setSide(Side.SERVER)
.setApplyIf(() -> FixesConfig.fixMorpheusWaking).addTargetedMod(TargetedMod.MORPHEUS));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.mitchej123.hodgepodge.mixins.late.morpheus;

import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.quetzi.morpheus.SleepChecker;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.mitchej123.hodgepodge.mixins.early.minecraft.WorldServerAccessor;

@Mixin(value = SleepChecker.class, remap = false)
public class MixinMorpheusWakePlayers {

Expand All @@ -21,8 +20,8 @@ public class MixinMorpheusWakePlayers {
shift = At.Shift.BEFORE),
cancellable = true)
public void hodgepodge$fixWakePlayers(World world, CallbackInfo c) {
if (!(world instanceof WorldServerAccessor worldServer)) return;
worldServer.hodgepodge$wakeAllPlayers();
if (!(world instanceof WorldServer worldServer)) return;
worldServer.wakeAllPlayers();
c.cancel();
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/hodgepodge_at.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ public net.minecraft.client.resources.AbstractResourcePack field_110597_b # reso
public net.minecraft.client.resources.FallbackResourceManager field_110540_a # resourcePacks
public net.minecraft.client.resources.FileResourcePack field_110600_d # resourcePackZipFile
public net.minecraft.client.resources.SimpleReloadableResourceManager field_110548_a # domainResourceManagers
public net.minecraft.world.WorldServer func_73053_d()V # wakeAllPlayers()

0 comments on commit eb80e93

Please sign in to comment.