3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Merge branch 'master' into dev

Dieser Commit ist enthalten in:
Myles 2019-06-05 15:56:29 +01:00
Commit be5bf7961e
3 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -131,6 +131,7 @@ public class ChatRewriter {
}
private static void processTranslate(BaseComponent component) {
if (component == null) return;
if (component instanceof TranslatableComponent) {
String oldTranslate = ((TranslatableComponent) component).getTranslate();
String newTranslate;

Datei anzeigen

@ -1,7 +1,12 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets;
import com.github.steveice10.opennbt.conversion.ConverterRegistry;
import com.github.steveice10.opennbt.tag.builtin.*;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.github.steveice10.opennbt.tag.builtin.IntTag;
import com.github.steveice10.opennbt.tag.builtin.ListTag;
import com.github.steveice10.opennbt.tag.builtin.ShortTag;
import com.github.steveice10.opennbt.tag.builtin.StringTag;
import com.github.steveice10.opennbt.tag.builtin.Tag;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.primitives.Ints;
@ -717,7 +722,8 @@ public class InventoryPackets {
return null; // Not valid
}
int separatorIndex = newId.indexOf(':');
if (separatorIndex == -1 || separatorIndex == 0) { // Vanilla parses ``:`` and ```` as ``minecraft:``
// Vanilla parses ``:`` and ```` as ``minecraft:`` (also ensure there's enough space)
if ((separatorIndex == -1 || separatorIndex == 0) && newId.length() <= 10) {
newId = "minecraft:" + newId;
}
switch (newId) {
@ -744,7 +750,7 @@ public class InventoryPackets {
case "wdl:request":
return "WDL|REQUEST";
default:
return newId;
return newId.length() > 20 ? newId.substring(0, 20) : newId;
}
}

Datei anzeigen

@ -18,6 +18,7 @@ public class InventoryNameRewriter {
}
private static void processTranslate(BaseComponent component) {
if (component == null) return;
if (component instanceof TranslatableComponent) {
String oldTranslate = ((TranslatableComponent) component).getTranslate();