3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Fix 1.11 entity id rewriting not applying to dropped items

Dieser Commit ist enthalten in:
Myles 2017-06-24 15:40:09 +01:00
Ursprung 10688a7067
Commit f599583856

Datei anzeigen

@ -5,6 +5,7 @@ import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.entities.Entity1_11Types.EntityType; import us.myles.ViaVersion.api.entities.Entity1_11Types.EntityType;
import us.myles.ViaVersion.api.minecraft.item.Item;
import us.myles.ViaVersion.api.minecraft.metadata.Metadata; import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9; import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.Type;
@ -99,6 +100,10 @@ public class MetadataRewriter {
public static void handleMetadata(int entityId, EntityType type, List<Metadata> metadatas, UserConnection connection) { public static void handleMetadata(int entityId, EntityType type, List<Metadata> metadatas, UserConnection connection) {
for (Metadata metadata : new ArrayList<>(metadatas)) { for (Metadata metadata : new ArrayList<>(metadatas)) {
try { try {
if(metadata.getValue() instanceof Item) {
// Apply rewrite
EntityIdRewriter.toClientItem((Item) metadata.getValue());
}
if (type.is(EntityType.ELDER_GUARDIAN) || type.is(EntityType.GUARDIAN)) { // Guardians if (type.is(EntityType.ELDER_GUARDIAN) || type.is(EntityType.GUARDIAN)) { // Guardians
int oldid = metadata.getId(); int oldid = metadata.getId();
if (oldid == 12) { if (oldid == 12) {