This commit is contained in:
gnembon committed 2024-09-11 23:02:41 +02:00
1 parent 8f096dadb8
commit 299b93c215
6 files changed
+12 -19

No files matched your search

+2 -2
View File
@@ -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
@@ -2,6 +2,7 @@ package carpet.mixins;
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 org.spongepowered.asm.mixin.Shadow;
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<Entity> getOtherEntitiesLimited(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate, int limit) {
this.getProfiler().incrementCounter("getEntities"); // visit
Profiler.get().incrementCounter("getEntities"); // visit
AtomicInteger checkedEntities = new AtomicInteger();
List<Entity> list = Lists.newArrayList();
try {
@@ -55,9 +55,6 @@ public abstract class Level_getOtherEntitiesLimited implements LevelInterface {
return list;
}
@Shadow
public abstract ProfilerFiller getProfiler();
@Shadow
protected abstract LevelEntityGetter<Entity> getEntities();
}
@@ -4,6 +4,7 @@ import carpet.fakes.WorldChunkInterface;
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 abstract class Level_movableBEMixin implements LevelInterface, LevelAcces
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();
@@ -10,8 +10,6 @@ import org.spongepowered.asm.mixin.injection.At;
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<TickTask> implements MinecraftServerInterface
{
@@ -26,7 +24,7 @@ public abstract class MinecraftServer_tickspeedMixin extends ReentrantBlockableE
// 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 @@ public abstract class MinecraftServer_tickspeedMixin extends ReentrantBlockableE
CarpetProfiler.end_tick_profiling((MinecraftServer) (Object)this);
}
}
}
@@ -43,9 +43,10 @@ import static carpet.script.CarpetEventServer.Event.CHUNK_UNLOADED;
@Mixin(ServerLevel.class)
public abstract class ServerLevel_scarpetMixin extends Level implements ServerWorldInterface
{
protected ServerLevel_scarpetMixin(WritableLevelData writableLevelData, ResourceKey<Level> resourceKey, RegistryAccess registryAccess, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean bl, boolean bl2, long l, int i)
protected ServerLevel_scarpetMixin(WritableLevelData writableLevelData, ResourceKey<Level> resourceKey, RegistryAccess registryAccess, Holder<DimensionType> 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(
@@ -21,9 +21,9 @@ import net.minecraft.world.level.storage.WritableLevelData;
@Mixin(ServerLevel.class)
public abstract class ServerLevel_tickMixin extends Level implements LevelInterface
{
protected ServerLevel_tickMixin(final WritableLevelData writableLevelData, final ResourceKey<Level> resourceKey, final RegistryAccess registryAccess, final Holder<DimensionType> holder, final Supplier<ProfilerFiller> supplier, final boolean bl, final boolean bl2, final long l, final int i)
protected ServerLevel_tickMixin(final WritableLevelData writableLevelData, final ResourceKey<Level> resourceKey, final RegistryAccess registryAccess, final Holder<DimensionType> 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;