3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-07-06 07:38:03 +02:00

Handle item_name item data for component rewriting

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-06-17 12:58:39 +02:00
Ursprung bba0a3a3a6
Commit e662640377
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
3 geänderte Dateien mit 4 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -69,7 +69,7 @@ import java.util.logging.Logger;
public interface ViaBackwardsPlatform {
String MINIMUM_VV_VERSION = "5.0.0";
String MINIMUM_VV_VERSION = "5.0.1";
/**
* Initialize ViaBackwards.

Datei anzeigen

@ -67,14 +67,8 @@ public class BackwardsStructuredItemRewriter<C extends ClientboundPacketType, S
if (protocol.getComponentRewriter() != null) {
// Handle name and lore components
final StructuredData<Tag> customNameData = dataContainer.getNonEmpty(StructuredDataKey.CUSTOM_NAME);
if (customNameData != null) {
final Tag originalName = customNameData.value().copy();
protocol.getComponentRewriter().processTag(connection, customNameData.value());
if (!customNameData.value().equals(originalName)) {
saveTag(createCustomTag(item), originalName, "Name");
}
}
updateComponent(connection, item, StructuredDataKey.ITEM_NAME, "item_name");
updateComponent(connection, item, StructuredDataKey.CUSTOM_NAME, "custom_name");
final StructuredData<Tag[]> loreData = dataContainer.getNonEmpty(StructuredDataKey.LORE);
if (loreData != null) {
@ -115,7 +109,7 @@ public class BackwardsStructuredItemRewriter<C extends ClientboundPacketType, S
// Set custom name - only done if there is no original one
if (!dataContainer.contains(StructuredDataKey.CUSTOM_NAME)) {
dataContainer.set(StructuredDataKey.CUSTOM_NAME, mappedItem.tagName());
tag.putBoolean(nbtTagName("customName"), true);
tag.putBoolean(nbtTagName("added_custom_name"), true);
}
updateItemComponents(connection, dataContainer, this::handleItemToClient, itemIdRewriter, blockIdRewriter);

Datei anzeigen

@ -4,7 +4,6 @@ rootProject.name = "viabackwards-parent"
dependencyResolutionManagement {
repositories {
mavenLocal()
maven("https://repo.viaversion.com")
maven("https://repo.papermc.io/repository/maven-public/")
mavenCentral()