Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-10-05 01:31:05 +02:00
Make sure we actually have block mappings before trying to apply them
Dieser Commit ist enthalten in:
Ursprung
aa312f7332
Commit
f0c26d5967
@ -86,7 +86,13 @@ public class StructuredItemRewriter<C extends ClientboundPacketType, S extends S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateItemComponents(connection, dataContainer, this::handleItemToClient, mappingData != null ? mappingData::getNewItemId : null, mappingData != null ? mappingData::getNewBlockId : null);
|
Int2IntFunction itemIdRewriter = null;
|
||||||
|
Int2IntFunction blockIdRewriter = null;
|
||||||
|
if (mappingData != null) {
|
||||||
|
itemIdRewriter = mappingData.getItemMappings() != null ? mappingData::getNewItemId : null;
|
||||||
|
blockIdRewriter = mappingData.getBlockMappings() != null ? mappingData::getNewBlockId : null;
|
||||||
|
}
|
||||||
|
updateItemComponents(connection, dataContainer, this::handleItemToClient, itemIdRewriter, blockIdRewriter);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,13 +117,15 @@ public class StructuredItemRewriter<C extends ClientboundPacketType, S extends S
|
|||||||
}
|
}
|
||||||
|
|
||||||
restoreTextComponents(item);
|
restoreTextComponents(item);
|
||||||
updateItemComponents(connection, dataContainer, this::handleItemToServer, mappingData != null ? mappingData::getOldItemId : null, mappingData != null ? mappingData::getOldBlockId : null);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Temporary
|
Int2IntFunction itemIdRewriter = null;
|
||||||
protected void updateItemComponents(UserConnection connection, StructuredDataContainer container, ItemHandler itemHandler, @Nullable Int2IntFunction idRewriter) {
|
Int2IntFunction blockIdRewriter = null;
|
||||||
updateItemComponents(connection, container, itemHandler, idRewriter, null);
|
if (mappingData != null) {
|
||||||
|
itemIdRewriter = mappingData.getItemMappings() != null ? mappingData::getOldItemId : null;
|
||||||
|
blockIdRewriter = mappingData.getBlockMappings() != null ? mappingData::getOldBlockId : null;
|
||||||
|
}
|
||||||
|
updateItemComponents(connection, dataContainer, this::handleItemToServer, itemIdRewriter, blockIdRewriter);
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateItemComponents(UserConnection connection, StructuredDataContainer container, ItemHandler itemHandler, @Nullable Int2IntFunction idRewriter, @Nullable Int2IntFunction blockIdRewriter) {
|
protected void updateItemComponents(UserConnection connection, StructuredDataContainer container, ItemHandler itemHandler, @Nullable Int2IntFunction idRewriter, @Nullable Int2IntFunction blockIdRewriter) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren