26.3-rc-3
This commit is contained in:
1 parent
4a97c841b8
commit
7cfb996bd3
16 files changed
+121
-202
No files matched your search
@@ -1,33 +0,0 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.fakes.RandomStateVisitorAccessor;
|
||||
import net.minecraft.world.level.levelgen.densityfunction.DensityFunction;
|
||||
import net.minecraft.world.level.levelgen.RandomState;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
@Mixin(RandomState.class)
|
||||
public class RandomState_ScarpetMixin implements RandomStateVisitorAccessor {
|
||||
@Unique
|
||||
private DensityFunction.Visitor visitor;
|
||||
|
||||
@ModifyArg(
|
||||
method = "<init>",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/levelgen/NoiseRouter;mapAll(Lnet/minecraft/world/level/levelgen/densityfunction/DensityFunction$Visitor;)Lnet/minecraft/world/level/levelgen/NoiseRouter;"
|
||||
),
|
||||
index = 0
|
||||
)
|
||||
private DensityFunction.Visitor captureVisitor(DensityFunction.Visitor visitor) {
|
||||
this.visitor = visitor;
|
||||
return visitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DensityFunction.Visitor getVisitor() {
|
||||
return this.visitor;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public abstract class ServerChunkCacheMixin
|
||||
|
||||
@Shadow @Final private DistanceManager distanceManager;
|
||||
|
||||
@Redirect(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;J)V", at = @At(
|
||||
@Redirect(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;)V", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/DistanceManager;getNaturalSpawnChunkCount()I"
|
||||
))
|
||||
@@ -54,7 +54,7 @@ public abstract class ServerChunkCacheMixin
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;J)V", at = @At("RETURN"))
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;)V", at = @At("RETURN"))
|
||||
private void onFinishSpawnWorldCycle(CallbackInfo ci)
|
||||
{
|
||||
LevelData levelData = this.level.getLevelData(); // levelProperies class
|
||||
|
||||
@@ -19,13 +19,13 @@ public abstract class ServerChunkCache_profilerMixin
|
||||
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;J)V", at = @At("HEAD"))
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;)V", at = @At("HEAD"))
|
||||
private void startSpawningSection(CallbackInfo ci)
|
||||
{
|
||||
currentSection = CarpetProfiler.start_section(level, "Spawning", CarpetProfiler.TYPE.GENERAL);
|
||||
}
|
||||
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;J)V", at = @At("RETURN"))
|
||||
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;)V", at = @At("RETURN"))
|
||||
private void stopSpawningSection(CallbackInfo ci)
|
||||
{
|
||||
if (currentSection != null)
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public abstract class ServerGamePacketListenerImpl_antiCheatDisabledMixin extend
|
||||
return isSingleplayerOwner() || CarpetSettings.antiCheatDisabled;
|
||||
}
|
||||
|
||||
@Redirect(method = "handleMovePlayer", require = 0, // don't crash with immersive portals,
|
||||
@Redirect(method = "handlePlayerPositionChange", require = 0, // don't crash with immersive portals,
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/ServerPlayer;isChangingDimension()Z"))
|
||||
|
||||
@@ -122,11 +122,11 @@ public class ServerGamePacketListenerImpl_scarpetEventsMixin
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "handleMovePlayer", at = @At(
|
||||
@Inject(method = "handlePlayerPositionChange", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/ServerPlayer;jumpFromGround()V"
|
||||
))
|
||||
private void onJump(ServerboundMovePlayerPacket playerMoveC2SPacket_1, CallbackInfo ci)
|
||||
private void onJump(double requestedX, double requestedY, double requestedZ, float requestedYRot, float requestedXRot, boolean isOnGround, boolean horizontalCollision, CallbackInfo ci)
|
||||
{
|
||||
PLAYER_JUMPS.onPlayerEvent(player);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user