-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update used asset jar, update immersive portals compatibility
- Loading branch information
Showing
14 changed files
with
112 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
...java/eu/pb4/polymer/core/mixin/compat/immersive_portals/ip_ChunkDataSyncManagerMixin.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...n/java/eu/pb4/polymer/core/mixin/compat/immersive_portals/ip_PlayerChunkLoadingMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package eu.pb4.polymer.core.mixin.compat.immersive_portals; | ||
|
||
import eu.pb4.polymer.common.impl.CommonImplUtils; | ||
import net.minecraft.server.network.ServerPlayNetworkHandler; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.world.chunk.WorldChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import qouteall.imm_ptl.core.chunk_loading.PlayerChunkLoading; | ||
|
||
|
||
@Pseudo | ||
@Mixin(value = PlayerChunkLoading.class) | ||
public class ip_PlayerChunkLoadingMixin { | ||
@Inject(method = "sendChunkPacket", at = @At("HEAD"), require = 0) | ||
private static void polymer_setPlayerNow(ServerPlayNetworkHandler serverGamePacketListenerImpl, ServerWorld serverLevel, WorldChunk levelChunk, CallbackInfo ci) { | ||
CommonImplUtils.setPlayer(serverGamePacketListenerImpl.getPlayer()); | ||
} | ||
|
||
@Inject(method = "sendChunkPacket", at = @At("TAIL"), require = 0) | ||
private static void polymer_resetPlayer(ServerPlayNetworkHandler serverGamePacketListenerImpl, ServerWorld serverLevel, WorldChunk levelChunk, CallbackInfo ci) { | ||
CommonImplUtils.setPlayer(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
...src/main/java/eu/pb4/polymer/virtualentity/mixin/compat/ip_ChunkDataSyncManagerMixin.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...ntity/src/main/java/eu/pb4/polymer/virtualentity/mixin/compat/ip_ImmPtlChunkTracking.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package eu.pb4.polymer.virtualentity.mixin.compat; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import eu.pb4.polymer.virtualentity.impl.HolderHolder; | ||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import qouteall.imm_ptl.core.chunk_loading.ImmPtlChunkTracking; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Map; | ||
|
||
@Mixin(ImmPtlChunkTracking.class) | ||
public class ip_ImmPtlChunkTracking { | ||
@Inject(method = "lambda$purge$5", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V"), require = 0) | ||
private static void polymerVE$chunkUnload(Map.Entry e, CallbackInfoReturnable<Boolean> cir, @Local ServerPlayerEntity player, @Local ImmPtlChunkTracking.PlayerWatchRecord record) { | ||
for (var holder : new ArrayList<>(((HolderHolder) player.networkHandler).polymer$getHolders())) { | ||
if (holder.getAttachment() != null && holder.getChunkPos().toLong() == record.chunkPos) { | ||
holder.getAttachment().updateTracking(player.networkHandler); | ||
} | ||
} | ||
} | ||
|
||
@Inject(method = "lambda$forceRemovePlayer$16", at = @At(value = "INVOKE", target = "Lqouteall/imm_ptl/core/network/PacketRedirection;sendRedirectedMessage(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/network/packet/Packet;)V"), require = 0) | ||
private static void polymerVE$chunkUnload2(ServerPlayerEntity player, RegistryKey dim, Long2ObjectMap.Entry e, CallbackInfoReturnable<Boolean> cir, @Local ImmPtlChunkTracking.PlayerWatchRecord rec) { | ||
for (var holder : new ArrayList<>(((HolderHolder) player.networkHandler).polymer$getHolders())) { | ||
if (holder.getAttachment() != null && holder.getChunkPos().toLong() == rec.chunkPos) { | ||
holder.getAttachment().updateTracking(player.networkHandler); | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...y/src/main/java/eu/pb4/polymer/virtualentity/mixin/compat/ip_PlayerChunkLoadingMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package eu.pb4.polymer.virtualentity.mixin.compat; | ||
|
||
import eu.pb4.polymer.virtualentity.impl.HolderAttachmentHolder; | ||
import net.minecraft.server.network.ServerPlayNetworkHandler; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.world.chunk.WorldChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import qouteall.imm_ptl.core.chunk_loading.PlayerChunkLoading; | ||
import qouteall.imm_ptl.core.network.PacketRedirection; | ||
|
||
@Pseudo | ||
@Mixin(value = PlayerChunkLoading.class) | ||
public class ip_PlayerChunkLoadingMixin { | ||
|
||
@Inject(method = "sendChunkPacket", at = @At("TAIL"), require = 0) | ||
private static void polymerVE$addToPlayerPlayer(ServerPlayNetworkHandler serverGamePacketListenerImpl, ServerWorld serverLevel, WorldChunk levelChunk, CallbackInfo ci) { | ||
if (!serverGamePacketListenerImpl.player.isDead()) { | ||
PacketRedirection.withForceRedirect(serverLevel, () -> { | ||
for (var hologram : ((HolderAttachmentHolder) levelChunk).polymerVE$getHolders()) { | ||
hologram.startWatching(serverGamePacketListenerImpl); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters