Deleting a Map from NMS resulted in unsupported #282

Closed
opened 2024-08-26 12:43:32 +02:00 by SharkPika · 3 comments
SharkPika commented 2024-08-26 12:43:32 +02:00 (Migrated from github.com)

Expected behavior

Citizens plugin's NPCs of type Player cannot be displayed

Observed/Actual behavior

Citizens plugin's NPCs of type Player cannot be displayed

Steps/models to reproduce

paper
picture: has Int2ObjectMap K
but in folia there didnt have Int2ObjectMap K
but Citizens plugin need it
how can I do to fix it
Citizens code:
@Override
public EntityPacketTracker getPacketTracker(org.bukkit.entity.Entity entity) {
ServerLevel server = (ServerLevel) getHandle(entity).level();
TrackedEntity entry = server.getChunkSource().chunkMap.entityMap.get(entity.getEntityId());
if (entry == null)
return null;
return new EntityPacketTracker() {
@Override
public void link(Player player) {
entry.updatePlayer((ServerPlayer) getHandle(player));
}

        @Override
        public void run() {
        }

        @Override
        public void unlink(Player player) {
            entry.removePlayer((ServerPlayer) getHandle(player));
        }

        @Override
        public void unlinkAll(Consumer<Player> callback) {
            entry.broadcastRemoved();
        }
    };
}

the entityMap is K

Plugin and Datapack List

Citizens

Folia version

1.20.4

Other

No response

### Expected behavior Citizens plugin's NPCs of type Player cannot be displayed ### Observed/Actual behavior Citizens plugin's NPCs of type Player cannot be displayed ### Steps/models to reproduce ![paper](https://github.com/user-attachments/assets/2c31b53a-1370-46de-96b9-3fda78d576ad) picture: has Int2ObjectMap<EntityTracker> K but in folia there didnt have Int2ObjectMap<EntityTracker> K but Citizens plugin need it how can I do to fix it Citizens code: @Override public EntityPacketTracker getPacketTracker(org.bukkit.entity.Entity entity) { ServerLevel server = (ServerLevel) getHandle(entity).level(); TrackedEntity entry = server.getChunkSource().chunkMap.entityMap.get(entity.getEntityId()); if (entry == null) return null; return new EntityPacketTracker() { @Override public void link(Player player) { entry.updatePlayer((ServerPlayer) getHandle(player)); } @Override public void run() { } @Override public void unlink(Player player) { entry.removePlayer((ServerPlayer) getHandle(player)); } @Override public void unlinkAll(Consumer<Player> callback) { entry.broadcastRemoved(); } }; } the entityMap is K ### Plugin and Datapack List Citizens ### Folia version 1.20.4 ### Other _No response_
Nacioszeczek commented 2024-08-26 12:56:04 +02:00 (Migrated from github.com)

Please do not download the above file.

Please do not download the above file.
SharkPika commented 2024-08-26 15:48:29 +02:00 (Migrated from github.com)

Please do not download the above file.

ik, ty

> Please do not download the above file. ik, ty
Warriorrrr commented 2024-08-29 09:39:07 +02:00 (Migrated from github.com)

Folia has to make a lot of changes internally to work properly and safely, re-adding that map is not possible. Plugins have to adapt to folia, not the other way around.

Folia has to make a lot of changes internally to work properly and safely, re-adding that map is not possible. Plugins have to adapt to folia, not the other way around.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Minecraft/Folia#282
No description provided.