20w06a
This commit is contained in:
1 parent
1cf3b082d9
commit
9fa0e6109b
4 files changed
+24
-22
No files matched your search
@@ -2,9 +2,10 @@ package carpet.mixins;
|
||||
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.class_4758;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.profiler.DisableableProfiler;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -27,9 +28,9 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
|
||||
@Shadow @Final private static Logger LOGGER;
|
||||
|
||||
@Shadow private boolean profilerStartQueued;
|
||||
//@Shadow private boolean profilerStartQueued;
|
||||
|
||||
@Shadow @Final private DisableableProfiler profiler;
|
||||
@Shadow @Final private Profiler profiler;
|
||||
|
||||
@Shadow protected abstract void tick(BooleanSupplier booleanSupplier_1);
|
||||
|
||||
@@ -43,6 +44,8 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
|
||||
@Shadow private volatile boolean loading;
|
||||
|
||||
@Shadow protected abstract void method_24487(class_4758 arg);
|
||||
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
|
||||
private float carpetMsptAccum = 0.0f;
|
||||
@@ -105,12 +108,8 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
}
|
||||
|
||||
this.timeReference += msThisTick;//50L;
|
||||
if (this.profilerStartQueued)
|
||||
{
|
||||
this.profilerStartQueued = false;
|
||||
this.profiler.getController().enable();
|
||||
}
|
||||
|
||||
class_4758 lv = class_4758.method_24341("Server");
|
||||
this.method_24487(lv);
|
||||
this.profiler.startTick();
|
||||
this.profiler.push("tick");
|
||||
this.tick(TickSpeed.time_warp_start_time != 0 ? ()->true : this::shouldKeepTicking);
|
||||
|
||||
@@ -23,18 +23,21 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Mixin(ServerWorld.class)
|
||||
public abstract class ServerWorld_tickMixin extends World
|
||||
{
|
||||
protected ServerWorld_tickMixin(LevelProperties levelProperties, DimensionType dimensionType, BiFunction<World, Dimension, ChunkManager> chunkManagerProvider, Supplier<Profiler> supplier, boolean isClient)
|
||||
{
|
||||
super(levelProperties, dimensionType, chunkManagerProvider, supplier, isClient);
|
||||
}
|
||||
|
||||
@Shadow protected abstract void sendBlockActions();
|
||||
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
|
||||
protected ServerWorld_tickMixin(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1)
|
||||
{
|
||||
super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1);
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
value = "CONSTANT",
|
||||
|
||||
@@ -29,9 +29,6 @@ public abstract class World_movableTEMixin implements WorldInterface
|
||||
@Shadow
|
||||
@Final
|
||||
protected LevelProperties properties;
|
||||
@Shadow
|
||||
@Final
|
||||
private Profiler profiler;
|
||||
|
||||
@Shadow
|
||||
public abstract WorldChunk getWorldChunk(BlockPos blockPos_1);
|
||||
@@ -49,14 +46,16 @@ public abstract class World_movableTEMixin implements WorldInterface
|
||||
public abstract void updateListeners(BlockPos var1, BlockState var2, BlockState var3, int var4);
|
||||
|
||||
@Shadow
|
||||
public abstract void updateNeighbors(BlockPos blockPos_1, Block block_1);
|
||||
public abstract void updateNeighborsAlways(BlockPos blockPos_1, Block block_1);
|
||||
|
||||
@Shadow
|
||||
public abstract void updateHorizontalAdjacent(BlockPos blockPos_1, Block block_1);
|
||||
|
||||
@Shadow
|
||||
public abstract void onBlockChanged(BlockPos blockPos_1, BlockState blockState_1, BlockState blockState_2);
|
||||
|
||||
|
||||
@Shadow public abstract Profiler getProfiler();
|
||||
|
||||
/**
|
||||
* @author 2No2Name
|
||||
*/
|
||||
@@ -94,9 +93,10 @@ public abstract class World_movableTEMixin implements WorldInterface
|
||||
|
||||
if (blockState_3 != blockState_2 && (blockState_3.getOpacity((BlockView) this, blockPos_1) != blockState_2.getOpacity((BlockView) this, blockPos_1) || blockState_3.getLuminance() != blockState_2.getLuminance() || blockState_3.hasSidedTransparency() || blockState_2.hasSidedTransparency()))
|
||||
{
|
||||
this.profiler.push("queueCheckLight");
|
||||
Profiler profiler = getProfiler();
|
||||
profiler.push("queueCheckLight");
|
||||
this.getChunkManager().getLightingProvider().checkBlock(blockPos_1);
|
||||
this.profiler.pop();
|
||||
profiler.pop();
|
||||
}
|
||||
|
||||
if (blockState_3 == blockState_1)
|
||||
@@ -113,7 +113,7 @@ public abstract class World_movableTEMixin implements WorldInterface
|
||||
|
||||
if (!this.isClient && (int_1 & 1) != 0)
|
||||
{
|
||||
this.updateNeighbors(blockPos_1, blockState_2.getBlock());
|
||||
this.updateNeighborsAlways(blockPos_1, blockState_2.getBlock());
|
||||
if (blockState_1.hasComparatorOutput())
|
||||
{
|
||||
this.updateHorizontalAdjacent(blockPos_1, block_1);
|
||||
|
||||
Reference in new issue
Block a user