19w45a
This commit is contained in:
1 parent
6dd31329b7
commit
ec19e37a74
9 files changed
+29
-29
No files matched your search
@@ -32,6 +32,6 @@ public abstract class FloatingIslandsChunkGeneratorMixin extends SurfaceChunkGen
|
||||
return Feature.END_CITY.getMonsterSpawns();
|
||||
}
|
||||
}
|
||||
return this.world.getBiome(blockPos_1).getEntitySpawnList(entityCategory_1);
|
||||
return this.world.method_23753(blockPos_1).getEntitySpawnList(entityCategory_1);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import carpet.CarpetServer;
|
||||
import carpet.fakes.MinecraftServerInterface;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.ServerTask;
|
||||
import net.minecraft.util.NonBlockingThreadExecutor;
|
||||
import net.minecraft.util.SystemUtil;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.thread.ReentrantThreadExecutor;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -19,7 +19,7 @@ import static carpet.script.CarpetEventServer.Event.NETHER_TICK;
|
||||
import static carpet.script.CarpetEventServer.Event.TICK;
|
||||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public abstract class MinecraftServer_scarpetMixin extends NonBlockingThreadExecutor<ServerTask> implements MinecraftServerInterface
|
||||
public abstract class MinecraftServer_scarpetMixin extends ReentrantThreadExecutor<ServerTask> implements MinecraftServerInterface
|
||||
{
|
||||
public MinecraftServer_scarpetMixin(String string_1)
|
||||
{
|
||||
@@ -32,14 +32,14 @@ public abstract class MinecraftServer_scarpetMixin extends NonBlockingThreadExec
|
||||
|
||||
@Shadow private long field_4557;
|
||||
|
||||
@Shadow public abstract boolean executeQueuedTask();
|
||||
@Shadow public abstract boolean runTask();
|
||||
|
||||
@Override
|
||||
public void forceTick(BooleanSupplier isAhead)
|
||||
{
|
||||
timeReference = field_4557 = SystemUtil.getMeasuringTimeMs();
|
||||
timeReference = field_4557 = Util.getMeasuringTimeMs();
|
||||
tick(isAhead);
|
||||
executeQueuedTasks();
|
||||
runTask();
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
|
||||
@@ -3,7 +3,7 @@ package carpet.mixins;
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.SystemUtil;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.profiler.DisableableProfiler;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
@@ -61,7 +61,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
{
|
||||
while (this.running)
|
||||
{
|
||||
//long long_1 = SystemUtil.getMeasuringTimeMs() - this.timeReference;
|
||||
//long long_1 = Util.getMeasuringTimeMs() - this.timeReference;
|
||||
//CM deciding on tick speed
|
||||
if (CarpetProfiler.tick_health_requested != 0L)
|
||||
{
|
||||
@@ -72,12 +72,12 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
if (TickSpeed.time_warp_start_time != 0 && TickSpeed.continueWarp())
|
||||
{
|
||||
//making sure server won't flop after the warp or if the warp is interrupted
|
||||
this.timeReference = this.field_4557 = SystemUtil.getMeasuringTimeMs();
|
||||
this.timeReference = this.field_4557 = Util.getMeasuringTimeMs();
|
||||
}
|
||||
else
|
||||
{
|
||||
mspt = TickSpeed.mspt; // regular tick
|
||||
long_1 = SystemUtil.getMeasuringTimeMs() - this.timeReference;
|
||||
long_1 = Util.getMeasuringTimeMs() - this.timeReference;
|
||||
}
|
||||
//end tick deciding
|
||||
//smoothed out delay to include mcpt component. With 50L gives defaults.
|
||||
@@ -101,7 +101,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
this.tick(TickSpeed.time_warp_start_time != 0 ? ()->true : this::shouldKeepTicking);
|
||||
this.profiler.swap("nextTickWait");
|
||||
this.field_19249 = true;
|
||||
this.field_19248 = Math.max(SystemUtil.getMeasuringTimeMs() + /*50L*/ mspt, this.timeReference);
|
||||
this.field_19248 = Math.max(Util.getMeasuringTimeMs() + /*50L*/ mspt, this.timeReference);
|
||||
this.method_16208();
|
||||
this.profiler.pop();
|
||||
this.profiler.endTick();
|
||||
@@ -157,7 +157,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
}
|
||||
@Inject(method = "method_16208", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/MinecraftServer;executeTasks(Ljava/util/function/BooleanSupplier;)V",
|
||||
target = "Lnet/minecraft/server/MinecraftServer;runTasks(Ljava/util/function/BooleanSupplier;)V",
|
||||
shift = At.Shift.BEFORE
|
||||
))
|
||||
private void stopAsync(CallbackInfo ci)
|
||||
|
||||
@@ -4,7 +4,7 @@ import carpet.settings.CarpetSettings;
|
||||
import carpet.fakes.PistonBlockEntityInterface;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.PistonBlockEntity;
|
||||
import net.minecraft.client.render.LayeredVertexConsumerStorage;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.PistonBlockEntityRenderer;
|
||||
@@ -24,8 +24,8 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
|
||||
}
|
||||
|
||||
@Inject(method = "method_3576", at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;method_3575(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/LayeredVertexConsumerStorage;Lnet/minecraft/world/World;ZI)V", ordinal = 3))
|
||||
private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, MatrixStack matrixStack_1, LayeredVertexConsumerStorage layeredVertexConsumerStorage_1, int int_1, int int_2, CallbackInfo ci)
|
||||
target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;method_3575(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/world/World;ZI)V", ordinal = 3))
|
||||
private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, float float_1, MatrixStack matrixStack_1, VertexConsumerProvider layeredVertexConsumerStorage_1, int int_1, int int_2, CallbackInfo ci)
|
||||
//private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, class_4587 class_4587_1, class_4597 class_4597_1, int int_1, CallbackInfo ci)
|
||||
{
|
||||
if (!((PistonBlockEntityInterface) pistonBlockEntity_1).isRenderModeSet())
|
||||
@@ -34,7 +34,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
|
||||
|
||||
|
||||
@Inject(method = "method_3576", at = @At("RETURN"), locals = LocalCapture.NO_CAPTURE)
|
||||
private void endMethod3576(PistonBlockEntity pistonBlockEntity_1, double xOffset, double yOffset, double zOffset, float partialTicks, MatrixStack matrixStack_1, LayeredVertexConsumerStorage layeredVertexConsumerStorage_1, int int_1, int init_2, CallbackInfo ci)
|
||||
private void endMethod3576(PistonBlockEntity pistonBlockEntity_1, float partialTicks, MatrixStack matrixStack_1, VertexConsumerProvider layeredVertexConsumerStorage_1, int int_1, int init_2, CallbackInfo ci)
|
||||
{
|
||||
if (((PistonBlockEntityInterface) pistonBlockEntity_1).getRenderCarriedBlockEntity())
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
|
||||
pistonBlockEntity_1.getRenderOffsetY(partialTicks),
|
||||
pistonBlockEntity_1.getRenderOffsetZ(partialTicks)
|
||||
);
|
||||
BlockEntityRenderDispatcher.INSTANCE.render(carriedBlockEntity, partialTicks, matrixStack_1, layeredVertexConsumerStorage_1, xOffset, yOffset, zOffset);
|
||||
BlockEntityRenderDispatcher.INSTANCE.render(carriedBlockEntity, partialTicks, matrixStack_1, layeredVertexConsumerStorage_1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public abstract class SaplingBlockMixin
|
||||
cancellable = true)
|
||||
private void onGenerate(ServerWorld serverWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci)
|
||||
{
|
||||
if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1))
|
||||
if(CarpetSettings.desertShrubs && serverWorld_1.method_23753(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1))
|
||||
{
|
||||
serverWorld_1.setBlockState(blockPos_1, Blocks.DEAD_BUSH.getDefaultState(), 3);
|
||||
ci.cancel();
|
||||
|
||||
@@ -48,12 +48,12 @@ public class SpawnHelperMixin
|
||||
if (CarpetSettings.lagFreeSpawning)
|
||||
{
|
||||
BlockPos.Mutable blockpos = new BlockPos.Mutable();
|
||||
int minX = MathHelper.floor(bb.minX);
|
||||
int maxX = MathHelper.ceil(bb.maxX);
|
||||
int minY = MathHelper.floor(bb.minY);
|
||||
int maxY = MathHelper.ceil(bb.maxY);
|
||||
int minZ = MathHelper.floor(bb.minZ);
|
||||
int maxZ = MathHelper.ceil(bb.maxZ);
|
||||
int minX = MathHelper.floor(bb.x1);
|
||||
int maxX = MathHelper.ceil(bb.x2);
|
||||
int minY = MathHelper.floor(bb.y1);
|
||||
int maxY = MathHelper.ceil(bb.y2);
|
||||
int minZ = MathHelper.floor(bb.z1);
|
||||
int maxZ = MathHelper.ceil(bb.z2);
|
||||
for (int y = minY; y < maxY; y++)
|
||||
for (int x = minX; x < maxX; x++)
|
||||
for (int z = minZ; z < maxZ; z++)
|
||||
|
||||
@@ -31,7 +31,7 @@ public class WorldRenderer_pausedShakeMixin
|
||||
|
||||
@ModifyVariable(method = "render", argsOnly = true, ordinal = 0 ,at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/particle/ParticleManager;renderParticles(Lnet/minecraft/client/render/Camera;F)V",
|
||||
target = "Lnet/minecraft/client/particle/ParticleManager;renderParticles(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;Lnet/minecraft/client/render/LightmapTextureManager;Lnet/minecraft/client/render/Camera;F)V",
|
||||
shift = At.Shift.BEFORE
|
||||
))
|
||||
private float changeTickPhaseBack(float previous)
|
||||
|
||||
@@ -1061,7 +1061,7 @@ public class CarpetExpression
|
||||
BlockValue.LocatorResult locator = BlockValue.fromParams(cc, lv, 0);
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
BlockPos pos = locator.block.getPos();
|
||||
Biome biome = world.getBiome(pos);
|
||||
Biome biome = world.method_23753(pos);
|
||||
Value res = new StringValue(biome.getTranslationKey().replaceFirst("^biome\\.minecraft\\.", ""));
|
||||
return (_c, _t) -> res;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user