mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-02 09:09:55 +01:00
Re-add translatable handler to 1.14 item handling
Reeeee
This commit is contained in:
parent
3d50c36ce3
commit
e25abe57e0
@ -47,6 +47,8 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
|
|||||||
ListTag lore = tag.get("Lore");
|
ListTag lore = tag.get("Lore");
|
||||||
if (lore != null) {
|
if (lore != null) {
|
||||||
for (Tag loreEntry : lore) {
|
for (Tag loreEntry : lore) {
|
||||||
|
if (!(loreEntry instanceof StringTag)) continue;
|
||||||
|
|
||||||
StringTag stringTag = (StringTag) loreEntry;
|
StringTag stringTag = (StringTag) loreEntry;
|
||||||
String newValue = translatableRewriter.processText(stringTag.getValue());
|
String newValue = translatableRewriter.processText(stringTag.getValue());
|
||||||
if (stringTag.getValue().equals(newValue)) {
|
if (stringTag.getValue().equals(newValue)) {
|
||||||
|
@ -38,7 +38,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol {
|
|||||||
translatableRewriter.registerTitle(0x4F, 0x4B);
|
translatableRewriter.registerTitle(0x4F, 0x4B);
|
||||||
translatableRewriter.registerPing();
|
translatableRewriter.registerPing();
|
||||||
|
|
||||||
blockItemPackets = new BlockItemPackets1_14(this);
|
blockItemPackets = new BlockItemPackets1_14(this, translatableRewriter);
|
||||||
blockItemPackets.register();
|
blockItemPackets.register();
|
||||||
entityPackets = new EntityPackets1_14(this);
|
entityPackets = new EntityPackets1_14(this);
|
||||||
entityPackets.register();
|
entityPackets.register();
|
||||||
|
@ -5,6 +5,7 @@ import nl.matsv.viabackwards.ViaBackwards;
|
|||||||
import nl.matsv.viabackwards.api.entities.storage.EntityTracker;
|
import nl.matsv.viabackwards.api.entities.storage.EntityTracker;
|
||||||
import nl.matsv.viabackwards.api.rewriters.EnchantmentRewriter;
|
import nl.matsv.viabackwards.api.rewriters.EnchantmentRewriter;
|
||||||
import nl.matsv.viabackwards.api.rewriters.RecipeRewriter;
|
import nl.matsv.viabackwards.api.rewriters.RecipeRewriter;
|
||||||
|
import nl.matsv.viabackwards.api.rewriters.TranslatableRewriter;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
|
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data.BackwardsMappings;
|
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data.BackwardsMappings;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data.RecipeRewriter1_14;
|
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data.RecipeRewriter1_14;
|
||||||
@ -47,8 +48,8 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
|
|||||||
|
|
||||||
private EnchantmentRewriter enchantmentRewriter;
|
private EnchantmentRewriter enchantmentRewriter;
|
||||||
|
|
||||||
public BlockItemPackets1_14(Protocol1_13_2To1_14 protocol) {
|
public BlockItemPackets1_14(Protocol1_13_2To1_14 protocol, TranslatableRewriter translatableRewriter) {
|
||||||
super(protocol, null, BlockItemPackets1_14::getOldItemId, BlockItemPackets1_14::getNewItemId, id -> BackwardsMappings.itemMappings.getMappedItem(id));
|
super(protocol, translatableRewriter, BlockItemPackets1_14::getOldItemId, BlockItemPackets1_14::getNewItemId, id -> BackwardsMappings.itemMappings.getMappedItem(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user