Enderchest and Invisible Players fix. (#506)

* Fix EnderChests not showing on legacy servers (Hypixel)
Fix NPCs/Players sometimes being invisible

* Remove unused import

* Fix standard
This commit is contained in:
James Harrison 2020-05-08 03:49:44 +01:00 committed by GitHub
parent f11bae0bf0
commit 2355c503c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -63,8 +63,9 @@ public class JavaPlayerListEntryTranslator extends PacketTranslator<ServerPlayer
);
}
session.getEntityCache().addPlayerEntity(playerEntity);
playerEntity.setPlayerList(true);
playerEntity.setValid(true);
session.getEntityCache().addPlayerEntity(playerEntity);
translate.getEntries().add(SkinUtils.buildCachedEntry(entry.getProfile(), playerEntity.getGeyserId()));
} else {

View file

@ -3,7 +3,6 @@ package org.geysermc.connector.utils;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.nukkitx.math.vector.Vector3i;
import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.Translators;
import org.geysermc.connector.network.translators.world.block.entity.BlockEntityTranslator;
@ -13,13 +12,16 @@ public class BlockEntityUtils {
private static final BlockEntityTranslator EMPTY_TRANSLATOR = Translators.getBlockEntityTranslators().get("Empty");
public static String getBedrockBlockEntityId(String id) {
// This is the only exception when it comes to block entity ids
// These are the only exceptions when it comes to block entity ids
if (id.contains("piston_head"))
return "PistonArm";
if (id.contains("trapped_chest"))
return "Chest";
if (id.contains("EnderChest"))
return "EnderChest";
id = id.toLowerCase()
.replace("minecraft:", "")
.replace("_", " ");