chore
This commit is contained in:
1 file changed
-383
@@ -1,383 +0,0 @@
|
|||||||
package com.github.zly2006.carpetslsaddition.network.pca;
|
|
||||||
|
|
||||||
public class PcaSyncProtocol {
|
|
||||||
//
|
|
||||||
// public static final ReentrantLock lock = new ReentrantLock(true);
|
|
||||||
// public static final ReentrantLock pairLock = new ReentrantLock(true);
|
|
||||||
// // 发送包
|
|
||||||
// private static final Identifier ENABLE_PCA_SYNC_PROTOCOL = createId("enable_pca_sync_protocol");
|
|
||||||
// private static final Identifier DISABLE_PCA_SYNC_PROTOCOL = createId("disable_pca_sync_protocol");
|
|
||||||
// private static final Identifier UPDATE_ENTITY = createId("update_entity");
|
|
||||||
// private static final Identifier UPDATE_BLOCK_ENTITY = createId("update_block_entity");
|
|
||||||
// // 响应包
|
|
||||||
// private static final Identifier SYNC_BLOCK_ENTITY = createId("sync_block_entity");
|
|
||||||
// private static final Identifier SYNC_ENTITY = createId("sync_entity");
|
|
||||||
// private static final Identifier CANCEL_SYNC_BLOCK_ENTITY = createId("cancel_sync_block_entity");
|
|
||||||
// private static final Identifier CANCEL_SYNC_ENTITY = createId("cancel_sync_entity");
|
|
||||||
// private static final Map<ServerPlayerEntity, Pair<Identifier, BlockPos>> playerWatchBlockPos = new HashMap<>();
|
|
||||||
// private static final Map<ServerPlayerEntity, Pair<Identifier, Entity>> playerWatchEntity = new HashMap<>();
|
|
||||||
// private static final Map<Pair<Identifier, BlockPos>, Set<ServerPlayerEntity>> blockPosWatchPlayerSet = new HashMap<>();
|
|
||||||
// private static final Map<Pair<Identifier, Entity>, Set<ServerPlayerEntity>> entityWatchPlayerSet = new HashMap<>();
|
|
||||||
// private static final MutablePair<Identifier, Entity> identifierEntityPair = new MutablePair<>();
|
|
||||||
// private static final MutablePair<Identifier, BlockPos> identifierBlockPosPair = new MutablePair<>();
|
|
||||||
//
|
|
||||||
// // 通知客户端服务器已启用 PcaSyncProtocol
|
|
||||||
// public static void enablePcaSyncProtocol(@NotNull ServerPlayerEntity player) {
|
|
||||||
// // 在这写如果是在 BC 端的情况下,ServerPlayNetworking.canSend 在这个时机调用会出现错误
|
|
||||||
// ServerMain.LOGGER.debug("Try enablePcaSyncProtocol: {}", player.getName().getString());
|
|
||||||
// // bc 端比较奇怪,canSend 工作不正常
|
|
||||||
// // if (ServerPlayNetworking.canSend(player, ENABLE_PCA_SYNC_PROTOCOL)) {
|
|
||||||
// PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
|
|
||||||
// ServerPlayNetworking.send(player, ENABLE_PCA_SYNC_PROTOCOL, buf);
|
|
||||||
// ServerMain.LOGGER.debug("send enablePcaSyncProtocol to {}!", player.getName().getString());
|
|
||||||
// lock.lock();
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 通知客户端服务器已停用 PcaSyncProtocol
|
|
||||||
// public static void disablePcaSyncProtocol(@NotNull ServerPlayerEntity player) {
|
|
||||||
// PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
|
|
||||||
// ServerPlayNetworking.send(player, DISABLE_PCA_SYNC_PROTOCOL, buf);
|
|
||||||
// ServerMain.LOGGER.debug("send disablePcaSyncProtocol to {}!", player.getName().getString());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 通知客户端更新 Entity
|
|
||||||
// // 包内包含 World 的 Identifier, entityId, entity 的 nbt 数据
|
|
||||||
// // 传输 World 是为了通知客户端该 Entity 属于哪个 World
|
|
||||||
// public static void updateEntity(@NotNull ServerPlayerEntity player, @NotNull Entity entity) {
|
|
||||||
// PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
|
|
||||||
// buf.writeIdentifier(entity.getEntityWorld().getRegistryKey().getValue());
|
|
||||||
// buf.writeInt(entity.getId());
|
|
||||||
// buf.writeNbt(entity.writeNbt(new NbtCompound()));
|
|
||||||
// ServerPlayNetworking.send(player, UPDATE_ENTITY, buf);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 通知客户端更新 BlockEntity
|
|
||||||
// // 包内包含 World 的 Identifier, pos, blockEntity 的 nbt 数据
|
|
||||||
// // 传输 World 是为了通知客户端该 BlockEntity 属于哪个世界
|
|
||||||
// public static void updateBlockEntity(@NotNull ServerPlayerEntity player, @NotNull BlockEntity blockEntity) {
|
|
||||||
// World world = blockEntity.getWorld();
|
|
||||||
//
|
|
||||||
// // 在生成世界时可能会产生空指针
|
|
||||||
// if (world == null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
|
|
||||||
// buf.writeIdentifier(world.getRegistryKey().getValue());
|
|
||||||
// buf.writeBlockPos(blockEntity.getPos());
|
|
||||||
// buf.writeNbt(blockEntity.createNbt());
|
|
||||||
// ServerPlayNetworking.send(player, UPDATE_BLOCK_ENTITY, buf);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static void init() {
|
|
||||||
// ServerPlayNetworking.registerGlobalReceiver(SYNC_BLOCK_ENTITY, PcaSyncProtocol::syncBlockEntityHandler);
|
|
||||||
// ServerPlayNetworking.registerGlobalReceiver(SYNC_ENTITY, PcaSyncProtocol::syncEntityHandler);
|
|
||||||
// ServerPlayNetworking.registerGlobalReceiver(CANCEL_SYNC_BLOCK_ENTITY, PcaSyncProtocol::cancelSyncBlockEntityHandler);
|
|
||||||
// ServerPlayNetworking.registerGlobalReceiver(CANCEL_SYNC_ENTITY, PcaSyncProtocol::cancelSyncEntityHandler);
|
|
||||||
// ServerPlayConnectionEvents.JOIN.register(PcaSyncProtocol::onJoin);
|
|
||||||
// ServerPlayConnectionEvents.DISCONNECT.register(PcaSyncProtocol::onDisconnect);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void onDisconnect(ServerPlayNetworkHandler serverPlayNetworkHandler, MinecraftServer minecraftServer) {
|
|
||||||
// if (SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// ServerMain.LOGGER.debug("onDisconnect remove: {}", serverPlayNetworkHandler.player.getName().getString());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void onJoin(ServerPlayNetworkHandler serverPlayNetworkHandler, PacketSender packetSender, MinecraftServer minecraftServer) {
|
|
||||||
// if (SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// enablePcaSyncProtocol(serverPlayNetworkHandler.player);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 客户端通知服务端取消 BlockEntity 同步
|
|
||||||
// private static void cancelSyncBlockEntityHandler(MinecraftServer server, ServerPlayerEntity player,
|
|
||||||
// ServerPlayNetworkHandler handler, PacketByteBuf buf,
|
|
||||||
// PacketSender responseSender) {
|
|
||||||
// if (!SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// ServerMain.LOGGER.debug("{} cancel watch blockEntity.", player.getName().getString());
|
|
||||||
// PcaSyncProtocol.clearPlayerWatchBlock(player);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 客户端通知服务端取消 Entity 同步
|
|
||||||
// private static void cancelSyncEntityHandler(MinecraftServer server, ServerPlayerEntity player,
|
|
||||||
// ServerPlayNetworkHandler handler, PacketByteBuf buf,
|
|
||||||
// PacketSender responseSender) {
|
|
||||||
// if (!SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// ServerMain.LOGGER.debug("{} cancel watch entity.", player.getName().getString());
|
|
||||||
// PcaSyncProtocol.clearPlayerWatchEntity(player);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 客户端请求同步 BlockEntity
|
|
||||||
// // 包内包含 pos
|
|
||||||
// // 由于正常的场景一般不会跨世界请求数据,因此包内并不包含 World,以玩家所在的 World 为准
|
|
||||||
// private static void syncBlockEntityHandler(MinecraftServer server, ServerPlayerEntity player,
|
|
||||||
// ServerPlayNetworkHandler handler, PacketByteBuf buf,
|
|
||||||
// PacketSender responseSender) {
|
|
||||||
// if (!SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// BlockPos pos = buf.readBlockPos();
|
|
||||||
// ServerWorld world = player.getServerWorld();
|
|
||||||
// BlockState blockState = world.getBlockState(pos);
|
|
||||||
// clearPlayerWatchData(player);
|
|
||||||
// ServerMain.LOGGER.debug("{} watch blockpos {}: {}", player.getName().getString(), pos, blockState);
|
|
||||||
//
|
|
||||||
// BlockEntity blockEntityAdj = null;
|
|
||||||
// // 不是单个箱子则需要更新隔壁箱子
|
|
||||||
// if (blockState.getBlock() instanceof ChestBlock) {
|
|
||||||
// if (blockState.get(ChestBlock.CHEST_TYPE) != ChestType.SINGLE) {
|
|
||||||
// BlockPos posAdj = pos.offset(ChestBlock.getFacing(blockState));
|
|
||||||
// // The method in World now checks that the caller is from the same thread...
|
|
||||||
// blockEntityAdj = world.getWorldChunk(posAdj).getBlockEntity(posAdj);
|
|
||||||
// }
|
|
||||||
// } else if (ServerMain.tisCarpetLoaded && blockState.isOf(Blocks.BARREL) && RuleHelper.getBooleanValue(getCarpetRule("largeBarrel"))) {
|
|
||||||
// Direction directionOpposite = blockState.get(BarrelBlock.FACING).getOpposite();
|
|
||||||
// BlockPos posAdj = pos.offset(directionOpposite);
|
|
||||||
// BlockState blockStateAdj = world.getBlockState(posAdj);
|
|
||||||
// if (blockStateAdj.isOf(Blocks.BARREL) && blockStateAdj.get(BarrelBlock.FACING) == directionOpposite) {
|
|
||||||
// blockEntityAdj = world.getWorldChunk(posAdj).getBlockEntity(posAdj);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (blockEntityAdj != null) {
|
|
||||||
// updateBlockEntity(player, blockEntityAdj);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 本来想判断一下 blockState 类型做个白名单的,考虑到 client 已经做了判断就不在服务端做判断了
|
|
||||||
// // 就算被恶意攻击应该不会造成什么损失
|
|
||||||
// // 大不了 op 直接拉黑
|
|
||||||
// // The method in World now checks that the caller is from the same thread...
|
|
||||||
// BlockEntity blockEntity = world.getWorldChunk(pos).getBlockEntity(pos);
|
|
||||||
// if (blockEntity != null) {
|
|
||||||
// updateBlockEntity(player, blockEntity);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Pair<Identifier, BlockPos> pair = new ImmutablePair<>(player.getEntityWorld().getRegistryKey().getValue(), pos);
|
|
||||||
// lock.lock();
|
|
||||||
// playerWatchBlockPos.put(player, pair);
|
|
||||||
// if (!blockPosWatchPlayerSet.containsKey(pair)) {
|
|
||||||
// blockPosWatchPlayerSet.put(pair, new HashSet<>());
|
|
||||||
// }
|
|
||||||
// blockPosWatchPlayerSet.get(pair).add(player);
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 客户端请求同步 Entity
|
|
||||||
// // 包内包含 entityId
|
|
||||||
// // 由于正常的场景一般不会跨世界请求数据,因此包内并不包含 World,以玩家所在的 World 为准
|
|
||||||
// private static void syncEntityHandler(MinecraftServer server, ServerPlayerEntity player,
|
|
||||||
// ServerPlayNetworkHandler handler, PacketByteBuf buf,
|
|
||||||
// PacketSender responseSender) {
|
|
||||||
// if (!SLSCarpetSettings.pcaSyncProtocol) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// int entityId = buf.readInt();
|
|
||||||
// ServerWorld world = player.getServerWorld();
|
|
||||||
// Entity entity = world.getEntityById(entityId);
|
|
||||||
// if (entity == null) {
|
|
||||||
// ServerMain.LOGGER.debug("Can't find entity {}.", entityId);
|
|
||||||
// } else {
|
|
||||||
// clearPlayerWatchData(player);
|
|
||||||
// if (entity instanceof PlayerEntity) {
|
|
||||||
// if (SLSCarpetSettings.pcaSyncPlayerEntity == SLSCarpetSettings.PCA_SYNC_PLAYER_ENTITY_OPTIONS.NOBODY) {
|
|
||||||
// return;
|
|
||||||
// } else if (SLSCarpetSettings.pcaSyncPlayerEntity == SLSCarpetSettings.PCA_SYNC_PLAYER_ENTITY_OPTIONS.BOT) {
|
|
||||||
// if (!(entity instanceof EntityPlayerMPFake)) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else if (SLSCarpetSettings.pcaSyncPlayerEntity == SLSCarpetSettings.PCA_SYNC_PLAYER_ENTITY_OPTIONS.OPS) {
|
|
||||||
// if (!(entity instanceof EntityPlayerMPFake) && server.getPermissionLevel(player.getGameProfile()) < 2) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else if (SLSCarpetSettings.pcaSyncPlayerEntity == SLSCarpetSettings.PCA_SYNC_PLAYER_ENTITY_OPTIONS.OPS_AND_SELF) {
|
|
||||||
// if (!(entity instanceof EntityPlayerMPFake) &&
|
|
||||||
// server.getPermissionLevel(player.getGameProfile()) < 2 &&
|
|
||||||
// entity != player) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else if (SLSCarpetSettings.pcaSyncPlayerEntity != SLSCarpetSettings.PCA_SYNC_PLAYER_ENTITY_OPTIONS.EVERYONE) {
|
|
||||||
// // wtf????
|
|
||||||
// ServerMain.LOGGER.warn("syncEntityHandler wtf???");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ServerMain.LOGGER.debug("{} watch entity {}: {}", player.getName().getString(), entityId, entity);
|
|
||||||
// updateEntity(player, entity);
|
|
||||||
//
|
|
||||||
// Pair<Identifier, Entity> pair = new ImmutablePair<>(entity.getEntityWorld().getRegistryKey().getValue(), entity);
|
|
||||||
// lock.lock();
|
|
||||||
// playerWatchEntity.put(player, pair);
|
|
||||||
// if (!entityWatchPlayerSet.containsKey(pair)) {
|
|
||||||
// entityWatchPlayerSet.put(pair, new HashSet<>());
|
|
||||||
// }
|
|
||||||
// entityWatchPlayerSet.get(pair).add(player);
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static MutablePair<Identifier, Entity> getIdentifierEntityPair(Identifier identifier, Entity entity) {
|
|
||||||
// pairLock.lock();
|
|
||||||
// identifierEntityPair.setLeft(identifier);
|
|
||||||
// identifierEntityPair.setRight(entity);
|
|
||||||
// pairLock.unlock();
|
|
||||||
// return identifierEntityPair;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static MutablePair<Identifier, BlockPos> getIdentifierBlockPosPair(Identifier identifier, BlockPos pos) {
|
|
||||||
// pairLock.lock();
|
|
||||||
// identifierBlockPosPair.setLeft(identifier);
|
|
||||||
// identifierBlockPosPair.setRight(pos);
|
|
||||||
// pairLock.unlock();
|
|
||||||
// return identifierBlockPosPair;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 工具
|
|
||||||
// private static @Nullable Set<ServerPlayerEntity> getWatchPlayerList(@NotNull Entity entity) {
|
|
||||||
// return entityWatchPlayerSet.get(getIdentifierEntityPair(entity.getEntityWorld().getRegistryKey().getValue(), entity));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static @Nullable Set<ServerPlayerEntity> getWatchPlayerList(@NotNull World world, @NotNull BlockPos blockPos) {
|
|
||||||
// return blockPosWatchPlayerSet.get(getIdentifierBlockPosPair(world.getRegistryKey().getValue(), blockPos));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static boolean syncEntityToClient(@NotNull Entity entity) {
|
|
||||||
// if (entity.getEntityWorld().isClient()) {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// lock.lock();
|
|
||||||
// Set<ServerPlayerEntity> playerList = getWatchPlayerList(entity);
|
|
||||||
// boolean ret = false;
|
|
||||||
// if (playerList != null) {
|
|
||||||
// for (ServerPlayerEntity player : playerList) {
|
|
||||||
// updateEntity(player, entity);
|
|
||||||
// ret = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// lock.unlock();
|
|
||||||
// return ret;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static boolean syncBlockEntityToClient(@NotNull BlockEntity blockEntity) {
|
|
||||||
// boolean ret = false;
|
|
||||||
// World world = blockEntity.getWorld();
|
|
||||||
// BlockPos pos = blockEntity.getPos();
|
|
||||||
// // 在生成世界时可能会产生空指针
|
|
||||||
// if (world != null) {
|
|
||||||
// if (world.isClient()) {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// BlockState blockState = world.getBlockState(pos);
|
|
||||||
// lock.lock();
|
|
||||||
// Set<ServerPlayerEntity> playerList = getWatchPlayerList(world, blockEntity.getPos());
|
|
||||||
//
|
|
||||||
// Set<ServerPlayerEntity> playerListAdj = null;
|
|
||||||
//
|
|
||||||
// if (blockState.getBlock() instanceof ChestBlock) {
|
|
||||||
// if (blockState.get(ChestBlock.CHEST_TYPE) != ChestType.SINGLE) {
|
|
||||||
// // 如果是一个大箱子需要特殊处理
|
|
||||||
// // 上面不用 isOf 是为了考虑到陷阱箱的情况,陷阱箱继承自箱子
|
|
||||||
// BlockPos posAdj = pos.offset(ChestBlock.getFacing(blockState));
|
|
||||||
// playerListAdj = getWatchPlayerList(world, posAdj);
|
|
||||||
// }
|
|
||||||
// } else if (ServerMain.tisCarpetLoaded && blockState.isOf(Blocks.BARREL) && RuleHelper.getBooleanValue(getCarpetRule("largeBarrel"))) {
|
|
||||||
// Direction directionOpposite = blockState.get(BarrelBlock.FACING).getOpposite();
|
|
||||||
// BlockPos posAdj = pos.offset(directionOpposite);
|
|
||||||
// BlockState blockStateAdj = world.getBlockState(posAdj);
|
|
||||||
// if (blockStateAdj.isOf(Blocks.BARREL) && blockStateAdj.get(BarrelBlock.FACING) == directionOpposite) {
|
|
||||||
// playerListAdj = getWatchPlayerList(world, posAdj);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (playerListAdj != null) {
|
|
||||||
// if (playerList == null) {
|
|
||||||
// playerList = playerListAdj;
|
|
||||||
// } else {
|
|
||||||
// playerList.addAll(playerListAdj);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (playerList != null) {
|
|
||||||
// for (ServerPlayerEntity player : playerList) {
|
|
||||||
// updateBlockEntity(player, blockEntity);
|
|
||||||
// ret = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
// return ret;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void clearPlayerWatchEntity(ServerPlayerEntity player) {
|
|
||||||
// lock.lock();
|
|
||||||
// Pair<Identifier, Entity> pair = playerWatchEntity.get(player);
|
|
||||||
// if (pair != null) {
|
|
||||||
// Set<ServerPlayerEntity> playerSet = entityWatchPlayerSet.get(pair);
|
|
||||||
// playerSet.remove(player);
|
|
||||||
// if (playerSet.isEmpty()) {
|
|
||||||
// entityWatchPlayerSet.remove(pair);
|
|
||||||
// }
|
|
||||||
// playerWatchEntity.remove(player);
|
|
||||||
// }
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void clearPlayerWatchBlock(ServerPlayerEntity player) {
|
|
||||||
// lock.lock();
|
|
||||||
// Pair<Identifier, BlockPos> pair = playerWatchBlockPos.get(player);
|
|
||||||
// if (pair != null) {
|
|
||||||
// Set<ServerPlayerEntity> playerSet = blockPosWatchPlayerSet.get(pair);
|
|
||||||
// playerSet.remove(player);
|
|
||||||
// if (playerSet.isEmpty()) {
|
|
||||||
// blockPosWatchPlayerSet.remove(pair);
|
|
||||||
// }
|
|
||||||
// playerWatchBlockPos.remove(player);
|
|
||||||
// }
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 停用 PcaSyncProtocol
|
|
||||||
// public static void disablePcaSyncProtocolGlobal() {
|
|
||||||
// lock.lock();
|
|
||||||
// playerWatchBlockPos.clear();
|
|
||||||
// playerWatchEntity.clear();
|
|
||||||
// blockPosWatchPlayerSet.clear();
|
|
||||||
// entityWatchPlayerSet.clear();
|
|
||||||
// lock.unlock();
|
|
||||||
// if (ServerMain.server != null) {
|
|
||||||
// for (ServerPlayerEntity player : ServerMain.server.getPlayerManager().getPlayerList()) {
|
|
||||||
// disablePcaSyncProtocol(player);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 启用 PcaSyncProtocol
|
|
||||||
// public static void enablePcaSyncProtocolGlobal() {
|
|
||||||
// if (ServerMain.server == null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// for (ServerPlayerEntity player : ServerMain.server.getPlayerManager().getPlayerList()) {
|
|
||||||
// enablePcaSyncProtocol(player);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // 删除玩家数据
|
|
||||||
// public static void clearPlayerWatchData(ServerPlayerEntity player) {
|
|
||||||
// PcaSyncProtocol.clearPlayerWatchBlock(player);
|
|
||||||
// PcaSyncProtocol.clearPlayerWatchEntity(player);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static CarpetRule<?> getCarpetRule(String rule){
|
|
||||||
// return CarpetServer.settingsManager.getCarpetRule(rule);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Contract(value = "_ -> new", pure = true)
|
|
||||||
// private static @NotNull Identifier createId(String name) {
|
|
||||||
// return new Identifier("pca", name);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user