This commit is contained in:
gnembon committed 2021-01-15 04:51:06 -04:00
1 parent 3e39548337
commit b14cf288a1
15 files changed
+97 -95

No files matched your search

@@ -40,7 +40,7 @@ public abstract class MinecraftServer_tickspeedMixin extends ReentrantThreadExec
@Shadow protected abstract boolean shouldKeepTicking();
@Shadow private long field_19248;
@Shadow private long nextTickTimestamp;
@Shadow protected abstract void method_16208();
@@ -127,7 +127,7 @@ public abstract class MinecraftServer_tickspeedMixin extends ReentrantThreadExec
while(this.runEveryTask()) {Thread.yield();}
}
this.waitingForNextTick = true;
this.field_19248 = Math.max(Util.getMeasuringTimeMs() + /*50L*/ msThisTick, this.timeReference);
this.nextTickTimestamp = Math.max(Util.getMeasuringTimeMs() + /*50L*/ msThisTick, this.timeReference);
// run all tasks (this will not do a lot when warping), but that's fine since we already run them
this.method_16208();
this.profiler.pop();
@@ -27,7 +27,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin implements BlockE
}
@Inject(method = "render", 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/VertexConsumerProvider;Lnet/minecraft/world/World;ZI)V", ordinal = 3))
target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;renderModel(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)
{
@@ -75,6 +75,6 @@ public class ServerPlayerInteractionManager_scarpetEventsMixin implements Server
public void setBlockBreakingProgress(int progress)
{
blockBreakingProgress = MathHelper.clamp(progress, -1, 10);
world.setBlockBreakingInfo(-1*this.player.getEntityId(), miningPos, blockBreakingProgress);
world.setBlockBreakingInfo(-1*this.player.getId(), miningPos, blockBreakingProgress);
}
}
@@ -3,16 +3,17 @@ package carpet.mixins;
import carpet.CarpetSettings;
import carpet.fakes.ServerWorldInterface;
import carpet.script.CarpetEventServer;
import net.minecraft.class_5568;
import net.minecraft.class_5579;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLike;
import net.minecraft.entity.LightningEntity;
import net.minecraft.server.world.ServerEntityManager;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.world.level.ServerWorldProperties;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@@ -42,12 +43,12 @@ public class ServerWorld_scarpetMixin implements ServerWorldInterface
@Redirect(method = "addEntity", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/class_5579;addEntity(Lnet/minecraft/class_5568;)Z"
target = "Lnet/minecraft/server/world/ServerEntityManager;addEntity(Lnet/minecraft/entity/EntityLike;)Z"
))
private boolean onEntityAddedToWorld(class_5579 class_5579, class_5568 arg)
private boolean onEntityAddedToWorld(ServerEntityManager serverEntityManager, EntityLike entityLike)
{
Entity entity = (Entity)arg;
boolean success = class_5579.addEntity(entity);
Entity entity = (Entity)entityLike;
boolean success = serverEntityManager.addEntity(entity);
if (success) {
CarpetEventServer.Event event = ENTITY_LOAD.get(entity.getType());
if (event != null) {
@@ -61,6 +62,7 @@ public class ServerWorld_scarpetMixin implements ServerWorldInterface
return success;
}
@Final
@Shadow
private ServerWorldProperties worldProperties;
public ServerWorldProperties getWorldPropertiesCM(){