Skip to content

Commit

Permalink
refactor: Replace an overwrite with an inject
Browse files Browse the repository at this point in the history
This should be better for mod compatibility.
  • Loading branch information
Steveplays28 committed Oct 1, 2023
1 parent c87b6d9 commit 413b76f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.level.ServerWorldProperties;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand Down Expand Up @@ -165,8 +168,9 @@ public void tickInject(BooleanSupplier shouldKeepTicking, CallbackInfo ci) {
* @author Steveplays28
* @reason Method's HUD messages conflicts with my custom HUD messages
*/
@Overwrite
private void sendSleepingStatus() {
@Inject(method = "sendSleepingStatus", at = @At(value = "HEAD"), cancellable = true)
private void sendSleepingStatus(CallbackInfo ci) {
ci.cancel();
}

@Inject(method = "tickTime", at = @At(value = "HEAD"), cancellable = true)
Expand Down

0 comments on commit 413b76f

Please sign in to comment.