From 299b93c215ae59771f4c0885be7411557ea4f3ab Mon Sep 17 00:00:00 2001 From: gnembon <41132274+gnembon@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:02:10 +0200 Subject: [PATCH] 24w37a --- gradle.properties | 4 ++-- .../java/carpet/mixins/Level_getOtherEntitiesLimited.java | 7 ++----- src/main/java/carpet/mixins/Level_movableBEMixin.java | 5 ++--- .../java/carpet/mixins/MinecraftServer_tickspeedMixin.java | 6 +----- src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java | 5 +++-- src/main/java/carpet/mixins/ServerLevel_tickMixin.java | 4 ++-- 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 48429a96e4..1ff30f6658 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check https://fabricmc.net/develop/ - minecraft_version=24w36a - loader_version=0.16.3 + minecraft_version=24w37a + loader_version=0.16.5 jsr305_version=3.0.2 fabric_version=0.102.0+1.21 diff --git a/src/main/java/carpet/mixins/Level_getOtherEntitiesLimited.java b/src/main/java/carpet/mixins/Level_getOtherEntitiesLimited.java index 4a6b4a7573..aeb607320a 100644 --- a/src/main/java/carpet/mixins/Level_getOtherEntitiesLimited.java +++ b/src/main/java/carpet/mixins/Level_getOtherEntitiesLimited.java @@ -2,6 +2,7 @@ import carpet.fakes.LevelInterface; import com.google.common.collect.Lists; +import net.minecraft.util.profiling.Profiler; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -9,7 +10,6 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.boss.EnderDragonPart; import net.minecraft.world.entity.boss.enderdragon.EnderDragon; @@ -24,7 +24,7 @@ public abstract class Level_getOtherEntitiesLimited implements LevelInterface { @Override public List getOtherEntitiesLimited(@Nullable Entity except, AABB box, Predicate predicate, int limit) { - this.getProfiler().incrementCounter("getEntities"); // visit + Profiler.get().incrementCounter("getEntities"); // visit AtomicInteger checkedEntities = new AtomicInteger(); List list = Lists.newArrayList(); try { @@ -55,9 +55,6 @@ public List getOtherEntitiesLimited(@Nullable Entity except, AABB box, P return list; } - @Shadow - public abstract ProfilerFiller getProfiler(); - @Shadow protected abstract LevelEntityGetter getEntities(); } diff --git a/src/main/java/carpet/mixins/Level_movableBEMixin.java b/src/main/java/carpet/mixins/Level_movableBEMixin.java index 99929fafc1..0f98fde7aa 100644 --- a/src/main/java/carpet/mixins/Level_movableBEMixin.java +++ b/src/main/java/carpet/mixins/Level_movableBEMixin.java @@ -4,6 +4,7 @@ import carpet.fakes.LevelInterface; import net.minecraft.core.BlockPos; import net.minecraft.server.level.FullChunkStatus; +import net.minecraft.util.profiling.Profiler; import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; @@ -39,8 +40,6 @@ public abstract class Level_movableBEMixin implements LevelInterface, LevelAcces @Shadow public abstract void onBlockStateChange(BlockPos blockPos_1, BlockState blockState_1, BlockState blockState_2); - @Shadow public abstract ProfilerFiller getProfiler(); - @Shadow public abstract void updateNeighbourForOutputSignal(BlockPos pos, Block block); @Shadow public abstract boolean isDebug(); @@ -79,7 +78,7 @@ public boolean setBlockStateWithBlockEntity(BlockPos blockPos_1, BlockState bloc if (blockState_3 != blockState_2 && (blockState_3.getLightBlock() != blockState_2.getLightBlock() || blockState_3.getLightEmission() != blockState_2.getLightEmission() || blockState_3.useShapeForLightOcclusion() || blockState_2.useShapeForLightOcclusion())) { - ProfilerFiller profiler = getProfiler(); + ProfilerFiller profiler = Profiler.get(); profiler.push("queueCheckLight"); this.getChunkSource().getLightEngine().checkBlock(blockPos_1); profiler.pop(); diff --git a/src/main/java/carpet/mixins/MinecraftServer_tickspeedMixin.java b/src/main/java/carpet/mixins/MinecraftServer_tickspeedMixin.java index e75fe66cb3..aba7780bd4 100644 --- a/src/main/java/carpet/mixins/MinecraftServer_tickspeedMixin.java +++ b/src/main/java/carpet/mixins/MinecraftServer_tickspeedMixin.java @@ -10,8 +10,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.function.BooleanSupplier; - @Mixin(value = MinecraftServer.class, priority = Integer.MAX_VALUE - 10) public abstract class MinecraftServer_tickspeedMixin extends ReentrantBlockableEventLoop implements MinecraftServerInterface { @@ -26,7 +24,7 @@ public MinecraftServer_tickspeedMixin(String name) // could possibly just inject that mspt selection at the beginning of the loop, but then adding all mspt's to // replace 50L will be a hassle @Inject(method = "runServer", at = @At(value = "INVOKE", shift = At.Shift.AFTER, - target = "Lnet/minecraft/server/MinecraftServer;startMetricsRecordingTick()V")) + target = "Lnet/minecraft/util/profiling/Profiler;get()Lnet/minecraft/util/profiling/ProfilerFiller;")) private void modifiedRunLoop(CallbackInfo ci) { if (CarpetProfiler.tick_health_requested != 0L) @@ -86,6 +84,4 @@ private void stopAsync(CallbackInfo ci) CarpetProfiler.end_tick_profiling((MinecraftServer) (Object)this); } } - - } diff --git a/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java b/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java index edaccc0e25..412302dadf 100644 --- a/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java +++ b/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java @@ -43,9 +43,10 @@ @Mixin(ServerLevel.class) public abstract class ServerLevel_scarpetMixin extends Level implements ServerWorldInterface { - protected ServerLevel_scarpetMixin(WritableLevelData writableLevelData, ResourceKey resourceKey, RegistryAccess registryAccess, Holder holder, Supplier supplier, boolean bl, boolean bl2, long l, int i) + + protected ServerLevel_scarpetMixin(WritableLevelData writableLevelData, ResourceKey resourceKey, RegistryAccess registryAccess, Holder holder, boolean bl, boolean bl2, long l, int i) { - super(writableLevelData, resourceKey, registryAccess, holder, supplier, bl, bl2, l, i); + super(writableLevelData, resourceKey, registryAccess, holder, bl, bl2, l, i); } @Inject(method = "tickChunk", locals = LocalCapture.CAPTURE_FAILHARD, at = @At( diff --git a/src/main/java/carpet/mixins/ServerLevel_tickMixin.java b/src/main/java/carpet/mixins/ServerLevel_tickMixin.java index 38a19e6958..4f3a166a68 100644 --- a/src/main/java/carpet/mixins/ServerLevel_tickMixin.java +++ b/src/main/java/carpet/mixins/ServerLevel_tickMixin.java @@ -21,9 +21,9 @@ @Mixin(ServerLevel.class) public abstract class ServerLevel_tickMixin extends Level implements LevelInterface { - protected ServerLevel_tickMixin(final WritableLevelData writableLevelData, final ResourceKey resourceKey, final RegistryAccess registryAccess, final Holder holder, final Supplier supplier, final boolean bl, final boolean bl2, final long l, final int i) + protected ServerLevel_tickMixin(final WritableLevelData writableLevelData, final ResourceKey resourceKey, final RegistryAccess registryAccess, final Holder holder, final boolean bl, final boolean bl2, final long l, final int i) { - super(writableLevelData, resourceKey, registryAccess, holder, supplier, bl, bl2, l, i); + super(writableLevelData, resourceKey, registryAccess, holder, bl, bl2, l, i); } private CarpetProfiler.ProfilerToken currentSection;