Skip to content

Commit

Permalink
24w37a
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Sep 11, 2024
1 parent 8f096da commit 299b93c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

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;

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;
Expand All @@ -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 {
Expand Down Expand Up @@ -55,9 +55,6 @@ public List<Entity> getOtherEntitiesLimited(@Nullable Entity except, AABB box, P
return list;
}

@Shadow
public abstract ProfilerFiller getProfiler();

@Shadow
protected abstract LevelEntityGetter<Entity> getEntities();
}
5 changes: 2 additions & 3 deletions src/main/java/carpet/mixins/Level_movableBEMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TickTask> implements MinecraftServerInterface
{
Expand All @@ -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)
Expand Down Expand Up @@ -86,6 +84,4 @@ private void stopAsync(CallbackInfo ci)
CarpetProfiler.end_tick_profiling((MinecraftServer) (Object)this);
}
}


}
5 changes: 3 additions & 2 deletions src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
@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(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpet/mixins/ServerLevel_tickMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
@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;
Expand Down

0 comments on commit 299b93c

Please sign in to comment.