Skip to content

Commit

Permalink
fix(fabric): tps/mspt on 1.18-pre1 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJtheRedstoner committed Nov 13, 2021
1 parent 745c5f8 commit 70c288d
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

import dev.cubxity.plugins.metrics.fabric.events.TickEvent;
import net.minecraft.server.MinecraftServer;
import org.objectweb.asm.Opcodes;
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.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import static dev.cubxity.plugins.metrics.api.metric.collector.CollectorKt.NANOSECONDS_PER_MILLISECOND;
Expand Down Expand Up @@ -59,19 +57,9 @@ private void onTickStart(CallbackInfo ci) {

@Inject(
method = "tick",
slice = @Slice(
from = @At(
value = "INVOKE",
target = "Lnet/minecraft/util/snooper/Snooper;update()V"
),
to = @At(
value = "FIELD",
target = "Lnet/minecraft/server/MinecraftServer;lastTickLengths:[J"
)
),
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/util/profiler/Profiler;pop()V"
value = "CONSTANT",
args = "stringValue=tallying"
)
)
private void onTickEnd(CallbackInfo ci) {
Expand Down

0 comments on commit 70c288d

Please sign in to comment.