Skip to content

Commit

Permalink
build: yarn 24w19b+build.4 impactful renames part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed May 12, 2024
1 parent b803128 commit 5265c0d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Mixin(ServerChunkManager.class)
public class MixinServerChunkManager {

@Redirect(method = "tickChunks", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;entryIterator()Ljava/lang/Iterable;"))
@Redirect(method = "tickChunks", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;entryIterator()Ljava/lang/Iterable;"))
private Iterable<ChunkHolder> redirectVisibleChunks(ServerChunkLoadingManager instance) {
return ((ITickableChunkSource) instance).vmp$tickableChunksIterator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class MixinThreadedAnvilChunkStorageEntityTracker {
@Unique
private int cachedMaxDistance = 0;

@Redirect(method = "updateTrackedStatus(Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage$EntityTracker;getMaxTrackDistance()I"))
@Redirect(method = "updateTrackedStatus(Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager$EntityTracker;getMaxTrackDistance()I"))
private int redirectGetMaxTrackDistance(ServerChunkLoadingManager.EntityTracker instance) {
final int ticks = ((IThreadedAnvilChunkStorage) field_18245).getWorld().getServer().getTicks();
if (lastDistanceUpdate != ticks || cachedMaxDistance == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mixin(value = ServerChunkLoadingManager.class, priority = 1005)
public class MixinTACSCancelSending {

// @Redirect(method = "updatePosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
// @Redirect(method = "updatePosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
// private void beforeWatchPacketsOnMoving(ThreadedAnvilChunkStorage instance, ServerPlayerEntity player) {
// // Stop packet sending, handled by distance map
// }
Expand All @@ -25,7 +25,7 @@ private Set<ServerPlayerEntity> redirectWatchPacketsOnChangingVD(PlayerChunkWatc
return Collections.emptySet(); // Stop packet sending, handled by distance map
}

// @Redirect(method = "handlePlayerAddedOrRemoved", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
// @Redirect(method = "handlePlayerAddedOrRemoved", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
// private void redirectWatchPacketOnPlayerChanges0(ThreadedAnvilChunkStorage instance, ServerPlayerEntity player) {
// // Stop packet sending, handled by distance map
// }
Expand All @@ -35,7 +35,7 @@ private void redirectChunkFilterSet(ServerPlayerEntity instance, ChunkFilter chu
// Stop packet sending, handled by distance map
}

// @Redirect(method = "handlePlayerAddedOrRemoved", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/server/network/ChunkFilter;)V"))
// @Redirect(method = "handlePlayerAddedOrRemoved", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;sendWatchPackets(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/server/network/ChunkFilter;)V"))
// private void redirectWatchPacketOnPlayerChanges1(ThreadedAnvilChunkStorage instance, ServerPlayerEntity player, ChunkFilter chunkFilter) {
// // Stop packet sending, handled by distance map
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public AreaPlayerChunkWatchingManager getAreaPlayerChunkWatchingManager() {
return this.areaPlayerChunkWatchingManager;
}

@Inject(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;setViewDistance(I)V"))
@Inject(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;setViewDistance(I)V"))
private void redirectNewPlayerChunkWatchingManager(CallbackInfo ci) {
this.areaPlayerChunkWatchingManager = new AreaPlayerChunkWatchingManager(
(player, chunkX, chunkZ) -> this.track(player, new ChunkPos(chunkX, chunkZ)),
Expand Down Expand Up @@ -166,7 +166,7 @@ private void onHandlePlayerAddedOrRemoved(ServerPlayerEntity player, boolean add
}
}

@Inject(method = "updatePosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;updateWatchedSection(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
@Inject(method = "updatePosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;updateWatchedSection(Lnet/minecraft/server/network/ServerPlayerEntity;)V"))
private void onPlayerSectionChange(ServerPlayerEntity player, CallbackInfo ci) {
this.vmp$updateWatchedSection(player);
this.areaPlayerChunkWatchingManager.movePlayer(player.getWatchedSection().toChunkPos().toLong(), player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class MixinThreadedAnvilChunkStorage {
private final NearbyEntityTracking nearbyEntityTracking = new NearbyEntityTracking();


@Redirect(method = "loadEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage$EntityTracker;updateTrackedStatus(Ljava/util/List;)V"))
@Redirect(method = "loadEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager$EntityTracker;updateTrackedStatus(Ljava/util/List;)V"))
private void redirectUpdateOnAddEntity(ServerChunkLoadingManager.EntityTracker instance, List<ServerPlayerEntity> players) {
if (((IThreadedAnvilChunkStorageEntityTracker) instance).getEntity() instanceof ServerPlayerEntity player) {
this.nearbyEntityTracking.addPlayer(player);
Expand All @@ -50,7 +50,7 @@ private <T> ObjectCollection<T> nullifyTrackerListOnRemoveEntity(Int2ObjectMap<T
else return instance.values();
}

@Redirect(method = "unloadEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage$EntityTracker;stopTracking()V"))
@Redirect(method = "unloadEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager$EntityTracker;stopTracking()V"))
private void redirectUpdateOnRemoveEntity(ServerChunkLoadingManager.EntityTracker instance) {
if (((IThreadedAnvilChunkStorageEntityTracker) instance).getEntity() instanceof ServerPlayerEntity player) {
this.nearbyEntityTracking.removePlayer(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void beforeStartTracking(ServerPlayerEntity player, CallbackInfo ci) {
}
}

@Redirect(method = "updateTrackedStatus(Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;isTracked(Lnet/minecraft/server/network/ServerPlayerEntity;II)Z"))
@Redirect(method = "updateTrackedStatus(Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;isTracked(Lnet/minecraft/server/network/ServerPlayerEntity;II)Z"))
private boolean assumeAlwaysTracked(ServerChunkLoadingManager instance, ServerPlayerEntity player, int chunkX, int chunkZ) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class MixinSpawnDensityCapper {

@Shadow
@Final
private ServerChunkLoadingManager threadedAnvilChunkStorage;
private ServerChunkLoadingManager chunkLoadingManager;

@Mutable
@Shadow @Final private Map<ServerPlayerEntity, SpawnDensityCapper.DensityCap> playersToDensityCap;
Expand All @@ -40,7 +40,7 @@ private void onInit(CallbackInfo info) {

@Unique
private Object[] getMobSpawnablePlayersArray(ChunkPos chunkPos) {
final AreaPlayerChunkWatchingManager manager = ((TACSExtension) this.threadedAnvilChunkStorage).getAreaPlayerChunkWatchingManager();
final AreaPlayerChunkWatchingManager manager = ((TACSExtension) this.chunkLoadingManager).getAreaPlayerChunkWatchingManager();
return manager.getPlayersInGeneralAreaMap(chunkPos.toLong());
}

Expand Down

0 comments on commit 5265c0d

Please sign in to comment.