Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817593ee43 | ||
|
|
044980c1a8 | ||
|
|
245bd53850 | ||
|
|
b632e4772f | ||
|
|
b336b8a1fc | ||
|
|
304b21425c | ||
|
|
bb17bb3bfd | ||
|
|
941bb91be8 | ||
|
|
fb334c6c14 | ||
|
|
90460ee99f | ||
|
|
81a737886a | ||
|
|
356158a9d4 | ||
|
|
32bd9378e1 | ||
|
|
317af16975 | ||
|
|
3826be4f5f | ||
|
|
282afe94cc | ||
|
|
9d86b31cb7 | ||
|
|
80041606a7 | ||
|
|
41e4172136 | ||
|
|
a856658399 | ||
|
|
7173bbbbce | ||
|
|
54507c6175 | ||
|
|
4dd7d384c8 | ||
|
|
fc751aedf3 | ||
|
|
a1da3dc11c | ||
|
|
87c37b08e8 | ||
|
|
187b79f4e1 | ||
|
|
b84cda54c3 | ||
|
|
f474067eb2 | ||
|
|
6a700d228d | ||
|
|
f08223d1e9 | ||
|
|
a5e3a6b563 |
No files matched your search
@@ -1,5 +1,6 @@
|
||||
name: Feature Request
|
||||
description: Suggest a feature to be added
|
||||
labels: [Feature Request]
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
@@ -34,4 +35,4 @@ body:
|
||||
description: |
|
||||
Does the feature apply to any specific version or environment?
|
||||
validations:
|
||||
required: false
|
||||
required: false
|
||||
@@ -11,7 +11,7 @@ Supported Versions
|
||||
**Green** = ViaVersion\
|
||||
**Purple** = ViaBackwards addition
|
||||
|
||||

|
||||

|
||||
|
||||
Releases / Dev Builds
|
||||
-
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group = "com.viaversion"
|
||||
version = "4.3.0"
|
||||
version = "4.4.1"
|
||||
description = "Allow older clients to join newer server versions."
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,11 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
|
||||
}
|
||||
|
||||
private void onServerLoaded() {
|
||||
if (isOutdatedPostLoad()) {
|
||||
disable();
|
||||
return;
|
||||
}
|
||||
|
||||
BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader();
|
||||
int protocolVersion = Via.getAPI().getServerVersion().highestSupportedVersion();
|
||||
if (protocolVersion >= ProtocolVersion.v1_16.getVersion()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
|
||||
fix1_13FormattedInventoryTitles = getBoolean("fix-formatted-inventory-titles", true);
|
||||
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
|
||||
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
|
||||
chatTypeFormats = get("chat-types", Map.class, new HashMap<String, String>());
|
||||
chatTypeFormats = get("chat-types-1_19_1", Map.class, new HashMap<String, String>());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ import com.viaversion.viabackwards.protocol.protocol1_16_4to1_17.Protocol1_16_4T
|
||||
import com.viaversion.viabackwards.protocol.protocol1_16to1_16_1.Protocol1_16To1_16_1;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.Protocol1_17_1To1_18;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_17to1_17_1.Protocol1_17To1_17_1;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.Protocol1_18_2To1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.Protocol1_18_2To1_19_1;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18to1_18_2.Protocol1_18To1_18_2;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_9_4to1_10.Protocol1_9_4To1_10;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
@@ -58,7 +58,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public interface ViaBackwardsPlatform {
|
||||
|
||||
String MINIMUM_VV_VERSION = "4.3.0";
|
||||
String MINIMUM_VV_VERSION = "4.4.1";
|
||||
String IMPL_VERSION = "$IMPL_VERSION";
|
||||
|
||||
/**
|
||||
@@ -70,14 +70,18 @@ public interface ViaBackwardsPlatform {
|
||||
|
||||
ViaBackwards.init(this, config);
|
||||
|
||||
if (isOutdated()) return;
|
||||
if (isOutdated()) {
|
||||
disable();
|
||||
return;
|
||||
}
|
||||
|
||||
Via.getManager().getSubPlatforms().add(IMPL_VERSION);
|
||||
|
||||
getLogger().info("Loading translations...");
|
||||
TranslatableRewriter.loadTranslatables();
|
||||
|
||||
ProtocolManager protocolManager = Via.getManager().getProtocolManager();
|
||||
final ProtocolManager protocolManager = Via.getManager().getProtocolManager();
|
||||
protocolManager.setMaxPathDeltaIncrease(1); // Since we skip 1.19
|
||||
protocolManager.registerProtocol(new Protocol1_9_4To1_10(), ProtocolVersion.v1_9_3, ProtocolVersion.v1_10);
|
||||
|
||||
protocolManager.registerProtocol(new Protocol1_10To1_11(), ProtocolVersion.v1_10, ProtocolVersion.v1_11);
|
||||
@@ -113,7 +117,8 @@ public interface ViaBackwardsPlatform {
|
||||
protocolManager.registerProtocol(new Protocol1_17_1To1_18(), ProtocolVersion.v1_17_1, ProtocolVersion.v1_18);
|
||||
protocolManager.registerProtocol(new Protocol1_18To1_18_2(), ProtocolVersion.v1_18, ProtocolVersion.v1_18_2);
|
||||
|
||||
protocolManager.registerProtocol(new Protocol1_18_2To1_19(), ProtocolVersion.v1_18_2, ProtocolVersion.v1_19);
|
||||
// 1.19.0 clients cannot join 1.19.1+ servers due to changes in the public profile key. 1.19.0 servers can use ViaBackwards 4.3.1
|
||||
protocolManager.registerProtocol(new Protocol1_18_2To1_19_1(), ProtocolVersion.v1_18_2, ProtocolVersion.v1_19_1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,11 +137,16 @@ public interface ViaBackwardsPlatform {
|
||||
getLogger().severe("LINK: https://ci.viaversion.com/");
|
||||
getLogger().severe("VIABACKWARDS WILL NOW DISABLE");
|
||||
getLogger().severe("================================");
|
||||
|
||||
disable();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isOutdatedPostLoad() {
|
||||
if (!Via.getPlatform().isProxy() && Via.getAPI().getServerVersion().highestSupportedVersion() == ProtocolVersion.v1_19.getVersion()) {
|
||||
// Print a warning but still allow it
|
||||
getLogger().warning("This version of ViaBackwards does not fully support 1.19 servers. Please downgrade to ViaBackwards 4.3.1 for better support of that version.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BackwardsMappings extends MappingDataBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadExtras(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings) {
|
||||
protected final void loadExtras(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings) {
|
||||
if (diffMappings != null) {
|
||||
JsonObject diffItems = diffMappings.getAsJsonObject("items");
|
||||
if (diffItems != null) {
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.viaversion.viaversion.libs.gson.JsonObject;
|
||||
import com.viaversion.viaversion.libs.gson.JsonPrimitive;
|
||||
import com.viaversion.viaversion.libs.gson.JsonSyntaxException;
|
||||
import com.viaversion.viaversion.util.GsonUtil;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
@@ -58,10 +59,14 @@ public final class VBMappingDataLoader {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static @Nullable InputStream getResource(String name) {
|
||||
return VBMappingDataLoader.class.getClassLoader().getResourceAsStream("assets/viabackwards/data/" + name);
|
||||
}
|
||||
|
||||
public static JsonObject loadData(String name) {
|
||||
InputStream stream = VBMappingDataLoader.class.getClassLoader().getResourceAsStream("assets/viabackwards/data/" + name);
|
||||
try (InputStreamReader reader = new InputStreamReader(stream)) {
|
||||
return GsonUtil.getGson().fromJson(reader, JsonObject.class);
|
||||
try (InputStream stream = getResource(name)) {
|
||||
if (stream == null) return null;
|
||||
return GsonUtil.getGson().fromJson(new InputStreamReader(stream), JsonObject.class);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
@@ -135,12 +140,12 @@ public final class VBMappingDataLoader {
|
||||
|
||||
public static Int2ObjectMap<MappedItem> loadItemMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) {
|
||||
Int2ObjectMap<MappedItem> itemMapping = new Int2ObjectOpenHashMap<>(diffMapping.size(), 0.99F);
|
||||
Object2IntMap<String> newIdenfierMap = MappingDataLoader.indexedObjectToMap(newMapping);
|
||||
Object2IntMap<String> oldIdenfierMap = MappingDataLoader.indexedObjectToMap(oldMapping);
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newMapping);
|
||||
Object2IntMap<String> oldIdentifierMap = MappingDataLoader.indexedObjectToMap(oldMapping);
|
||||
for (Map.Entry<String, JsonElement> entry : diffMapping.entrySet()) {
|
||||
JsonObject object = entry.getValue().getAsJsonObject();
|
||||
String mappedIdName = object.getAsJsonPrimitive("id").getAsString();
|
||||
int mappedId = newIdenfierMap.getInt(mappedIdName);
|
||||
int mappedId = newIdentifierMap.getInt(mappedIdName);
|
||||
if (mappedId == -1) {
|
||||
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("No key for " + mappedIdName + " :( ");
|
||||
@@ -148,7 +153,7 @@ public final class VBMappingDataLoader {
|
||||
continue;
|
||||
}
|
||||
|
||||
int oldId = oldIdenfierMap.getInt(entry.getKey());
|
||||
int oldId = oldIdentifierMap.getInt(entry.getKey());
|
||||
if (oldId == -1) {
|
||||
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("No old entry for " + mappedIdName + " :( ");
|
||||
@@ -162,8 +167,8 @@ public final class VBMappingDataLoader {
|
||||
|
||||
// Look for missing keys
|
||||
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings()) {
|
||||
for (Object2IntMap.Entry<String> entry : oldIdenfierMap.object2IntEntrySet()) {
|
||||
if (!newIdenfierMap.containsKey(entry.getKey()) && !itemMapping.containsKey(entry.getIntValue())) {
|
||||
for (Object2IntMap.Entry<String> entry : oldIdentifierMap.object2IntEntrySet()) {
|
||||
if (!newIdentifierMap.containsKey(entry.getKey()) && !itemMapping.containsKey(entry.getIntValue())) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("No item mapping for " + entry.getKey() + " :( ");
|
||||
}
|
||||
}
|
||||
|
||||
+187
-74
@@ -15,19 +15,21 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.api.BackwardsProtocol;
|
||||
import com.viaversion.viabackwards.api.rewriters.SoundRewriter;
|
||||
import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.data.BackwardsMappings;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.data.CommandRewriter1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.packets.BlockItemPackets1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.packets.EntityPackets1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage.DimensionRegistryStorage;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.data.BackwardsMappings;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.data.CommandRewriter1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.packets.BlockItemPackets1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.packets.EntityPackets1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage.DimensionRegistryStorage;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage.ReceivedMessagesStorage;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19Types;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
@@ -39,34 +41,44 @@ import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
import com.viaversion.viaversion.libs.gson.JsonElement;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.Component;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.TextReplacementConfig;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.TranslatableComponent;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.format.NamedTextColor;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.format.Style;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.format.TextDecoration;
|
||||
import com.viaversion.viaversion.libs.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ByteTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
|
||||
import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets;
|
||||
import com.viaversion.viaversion.protocols.base.ServerboundLoginPackets;
|
||||
import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.ServerboundPackets1_17;
|
||||
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPackets1_18;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ClientboundPackets1_19_1;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ServerboundPackets1_19_1;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.Protocol1_19To1_18_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ServerboundPackets1_19;
|
||||
import com.viaversion.viaversion.rewriter.CommandRewriter;
|
||||
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
|
||||
import com.viaversion.viaversion.rewriter.TagRewriter;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPackets1_19, ClientboundPackets1_18, ServerboundPackets1_19, ServerboundPackets1_17> {
|
||||
public final class Protocol1_18_2To1_19_1 extends BackwardsProtocol<ClientboundPackets1_19_1, ClientboundPackets1_18, ServerboundPackets1_19_1, ServerboundPackets1_17> {
|
||||
|
||||
public static final BackwardsMappings MAPPINGS = new BackwardsMappings();
|
||||
private static final String[] CHAT_KEYS = {"chat.type.text", null, null, "chat.type.announcement", "commands.message.display.incoming", "chat.type.team.text", "chat.type.emote", null};
|
||||
private static final UUID ZERO_UUID = new UUID(0, 0);
|
||||
private static final byte[] EMPTY_BYTES = new byte[0];
|
||||
private final EntityPackets1_19 entityRewriter = new EntityPackets1_19(this);
|
||||
private final BlockItemPackets1_19 blockItemPackets = new BlockItemPackets1_19(this);
|
||||
private final TranslatableRewriter translatableRewriter = new TranslatableRewriter(this);
|
||||
|
||||
public Protocol1_18_2To1_19() {
|
||||
super(ClientboundPackets1_19.class, ClientboundPackets1_18.class, ServerboundPackets1_19.class, ServerboundPackets1_17.class);
|
||||
public Protocol1_18_2To1_19_1() {
|
||||
super(ClientboundPackets1_19_1.class, ClientboundPackets1_18.class, ServerboundPackets1_19_1.class, ServerboundPackets1_17.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,23 +88,22 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
entityRewriter.onMappingDataLoaded();
|
||||
});
|
||||
|
||||
//TODO update translation mappings on release
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19.ACTIONBAR);
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19.TITLE_TEXT);
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19.TITLE_SUBTITLE);
|
||||
translatableRewriter.registerBossBar(ClientboundPackets1_19.BOSSBAR);
|
||||
translatableRewriter.registerDisconnect(ClientboundPackets1_19.DISCONNECT);
|
||||
translatableRewriter.registerTabList(ClientboundPackets1_19.TAB_LIST);
|
||||
translatableRewriter.registerOpenWindow(ClientboundPackets1_19.OPEN_WINDOW);
|
||||
translatableRewriter.registerCombatKill(ClientboundPackets1_19.COMBAT_KILL);
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_1.ACTIONBAR);
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_1.TITLE_TEXT);
|
||||
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_1.TITLE_SUBTITLE);
|
||||
translatableRewriter.registerBossBar(ClientboundPackets1_19_1.BOSSBAR);
|
||||
translatableRewriter.registerDisconnect(ClientboundPackets1_19_1.DISCONNECT);
|
||||
translatableRewriter.registerTabList(ClientboundPackets1_19_1.TAB_LIST);
|
||||
translatableRewriter.registerOpenWindow(ClientboundPackets1_19_1.OPEN_WINDOW);
|
||||
translatableRewriter.registerCombatKill(ClientboundPackets1_19_1.COMBAT_KILL);
|
||||
translatableRewriter.registerPing();
|
||||
|
||||
blockItemPackets.register();
|
||||
entityRewriter.register();
|
||||
|
||||
final SoundRewriter soundRewriter = new SoundRewriter(this);
|
||||
soundRewriter.registerStopSound(ClientboundPackets1_19.STOP_SOUND);
|
||||
registerClientbound(ClientboundPackets1_19.SOUND, new PacketRemapper() {
|
||||
soundRewriter.registerStopSound(ClientboundPackets1_19_1.STOP_SOUND);
|
||||
registerClientbound(ClientboundPackets1_19_1.SOUND, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Sound id
|
||||
@@ -106,7 +117,7 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
handler(soundRewriter.getSoundHandler());
|
||||
}
|
||||
});
|
||||
registerClientbound(ClientboundPackets1_19.ENTITY_SOUND, new PacketRemapper() {
|
||||
registerClientbound(ClientboundPackets1_19_1.ENTITY_SOUND, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Sound id
|
||||
@@ -118,7 +129,7 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
handler(soundRewriter.getSoundHandler());
|
||||
}
|
||||
});
|
||||
registerClientbound(ClientboundPackets1_19.NAMED_SOUND, new PacketRemapper() {
|
||||
registerClientbound(ClientboundPackets1_19_1.NAMED_SOUND, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.STRING); // Sound name
|
||||
@@ -138,15 +149,16 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
tagRewriter.removeTags("minecraft:instrument");
|
||||
tagRewriter.removeTags("minecraft:cat_variant");
|
||||
tagRewriter.removeTags("minecraft:painting_variant");
|
||||
tagRewriter.addEmptyTag(RegistryType.BLOCK, "minecraft:polar_bears_spawnable_on_in_frozen_ocean");
|
||||
tagRewriter.renameTag(RegistryType.BLOCK, "minecraft:wool_carpets", "minecraft:carpets");
|
||||
tagRewriter.renameTag(RegistryType.ITEM, "minecraft:wool_carpets", "minecraft:carpets");
|
||||
tagRewriter.addEmptyTag(RegistryType.ITEM, "minecraft:occludes_vibration_signals");
|
||||
tagRewriter.registerGeneric(ClientboundPackets1_19.TAGS);
|
||||
tagRewriter.registerGeneric(ClientboundPackets1_19_1.TAGS);
|
||||
|
||||
new StatisticsRewriter(this).register(ClientboundPackets1_19.STATISTICS);
|
||||
new StatisticsRewriter(this).register(ClientboundPackets1_19_1.STATISTICS);
|
||||
|
||||
final CommandRewriter commandRewriter = new CommandRewriter1_19(this);
|
||||
registerClientbound(ClientboundPackets1_19.DECLARE_COMMANDS, new PacketRemapper() {
|
||||
registerClientbound(ClientboundPackets1_19_1.DECLARE_COMMANDS, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
@@ -185,39 +197,89 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
}
|
||||
});
|
||||
|
||||
cancelClientbound(ClientboundPackets1_19.SERVER_DATA);
|
||||
cancelClientbound(ClientboundPackets1_19.CHAT_PREVIEW);
|
||||
cancelClientbound(ClientboundPackets1_19.SET_DISPLAY_CHAT_PREVIEW);
|
||||
registerClientbound(ClientboundPackets1_19.PLAYER_CHAT, ClientboundPackets1_18.CHAT_MESSAGE, new PacketRemapper() {
|
||||
cancelClientbound(ClientboundPackets1_19_1.SERVER_DATA);
|
||||
cancelClientbound(ClientboundPackets1_19_1.CHAT_PREVIEW);
|
||||
cancelClientbound(ClientboundPackets1_19_1.SET_DISPLAY_CHAT_PREVIEW);
|
||||
registerClientbound(ClientboundPackets1_19_1.PLAYER_CHAT, ClientboundPackets1_18.CHAT_MESSAGE, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
if (wrapper.read(Type.BOOLEAN)) {
|
||||
// Previous signature
|
||||
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE);
|
||||
}
|
||||
|
||||
final PlayerMessageSignature signature = wrapper.read(Type.PLAYER_MESSAGE_SIGNATURE);
|
||||
|
||||
// Store message signature for last seen
|
||||
if (!signature.uuid().equals(ZERO_UUID) && signature.signatureBytes().length != 0) {
|
||||
final ReceivedMessagesStorage messagesStorage = wrapper.user().get(ReceivedMessagesStorage.class);
|
||||
messagesStorage.add(signature);
|
||||
if (messagesStorage.tickUnacknowledged() > 64) {
|
||||
messagesStorage.resetUnacknowledgedCount();
|
||||
|
||||
// Send chat acknowledgement
|
||||
final PacketWrapper chatAckPacket = wrapper.create(ServerboundPackets1_19_1.CHAT_ACK);
|
||||
chatAckPacket.write(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY, messagesStorage.lastSignatures());
|
||||
chatAckPacket.write(Type.OPTIONAL_PLAYER_MESSAGE_SIGNATURE, null);
|
||||
chatAckPacket.sendToServer(Protocol1_18_2To1_19_1.class);
|
||||
}
|
||||
}
|
||||
|
||||
// Send the unsigned message if present, otherwise the signed message
|
||||
final JsonElement message = wrapper.read(Type.COMPONENT);
|
||||
final String plainMessage = wrapper.read(Type.STRING); // Plain message
|
||||
JsonElement message = null;
|
||||
JsonElement decoratedMessage = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||
if (decoratedMessage != null) {
|
||||
message = decoratedMessage;
|
||||
}
|
||||
|
||||
wrapper.read(Type.LONG); // Timestamp
|
||||
wrapper.read(Type.LONG); // Salt
|
||||
wrapper.read(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY); // Last seen
|
||||
|
||||
final JsonElement unsignedMessage = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||
wrapper.write(Type.COMPONENT, unsignedMessage != null ? unsignedMessage : message);
|
||||
});
|
||||
map(Type.VAR_INT, Type.BYTE); // Chat type
|
||||
map(Type.UUID); // Sender
|
||||
handler(wrapper -> {
|
||||
if (unsignedMessage != null) {
|
||||
message = unsignedMessage;
|
||||
}
|
||||
if (message == null) {
|
||||
// If no decorated or unsigned message is given, use the plain one
|
||||
message = GsonComponentSerializer.gson().serializeToTree(Component.text(plainMessage));
|
||||
}
|
||||
|
||||
final int filterMaskType = wrapper.read(Type.VAR_INT);
|
||||
if (filterMaskType == 2) { // Partially filtered
|
||||
wrapper.read(Type.LONG_ARRAY_PRIMITIVE); // Mask
|
||||
}
|
||||
|
||||
final int chatTypeId = wrapper.read(Type.VAR_INT);
|
||||
final JsonElement senderName = wrapper.read(Type.COMPONENT);
|
||||
final JsonElement teamName = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||
final JsonElement element = wrapper.get(Type.COMPONENT, 0);
|
||||
handleChatType(wrapper, senderName, teamName, element);
|
||||
final JsonElement targetName = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||
decoratedMessage = decorateChatMessage(wrapper, chatTypeId, senderName, targetName, message);
|
||||
if (decoratedMessage == null) {
|
||||
wrapper.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
translatableRewriter.processText(decoratedMessage);
|
||||
wrapper.write(Type.COMPONENT, decoratedMessage);
|
||||
wrapper.write(Type.BYTE, (byte) 1);
|
||||
wrapper.write(Type.UUID, signature.uuid());
|
||||
});
|
||||
read(Type.LONG); // Timestamp
|
||||
read(Type.LONG); // Salt
|
||||
read(Type.BYTE_ARRAY_PRIMITIVE); // Signature
|
||||
}
|
||||
});
|
||||
|
||||
registerClientbound(ClientboundPackets1_19.SYSTEM_CHAT, ClientboundPackets1_18.CHAT_MESSAGE, new PacketRemapper() {
|
||||
registerClientbound(ClientboundPackets1_19_1.SYSTEM_CHAT, ClientboundPackets1_18.CHAT_MESSAGE, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.COMPONENT); // Message
|
||||
map(Type.VAR_INT, Type.BYTE); // Chat type
|
||||
handler(wrapper -> {
|
||||
final JsonElement content = wrapper.passthrough(Type.COMPONENT);
|
||||
translatableRewriter.processText(content);
|
||||
|
||||
final boolean overlay = wrapper.read(Type.BOOLEAN);
|
||||
wrapper.write(Type.BYTE, overlay ? (byte) 2 : (byte) 0);
|
||||
});
|
||||
create(Type.UUID, ZERO_UUID); // Sender
|
||||
handler(wrapper -> handleChatType(wrapper, null, null, wrapper.get(Type.COMPONENT, 0)));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -230,14 +292,18 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
handler(wrapper -> {
|
||||
final String message = wrapper.get(Type.STRING, 0);
|
||||
if (!message.isEmpty() && message.charAt(0) == '/') {
|
||||
wrapper.setPacketType(ServerboundPackets1_19.CHAT_COMMAND);
|
||||
wrapper.setPacketType(ServerboundPackets1_19_1.CHAT_COMMAND);
|
||||
wrapper.set(Type.STRING, 0, message.substring(1));
|
||||
wrapper.write(Type.VAR_INT, 0); // No signatures
|
||||
wrapper.write(Type.BOOLEAN, false); // No signed preview
|
||||
} else {
|
||||
wrapper.write(Type.BYTE_ARRAY_PRIMITIVE, EMPTY_BYTES); // Signature
|
||||
wrapper.write(Type.BOOLEAN, false); // No signed preview
|
||||
}
|
||||
wrapper.write(Type.BOOLEAN, false); // No signed preview
|
||||
|
||||
final ReceivedMessagesStorage messagesStorage = wrapper.user().get(ReceivedMessagesStorage.class);
|
||||
messagesStorage.resetUnacknowledgedCount();
|
||||
wrapper.write(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY, messagesStorage.lastSignatures());
|
||||
wrapper.write(Type.OPTIONAL_PLAYER_MESSAGE_SIGNATURE, null); // No last unacknowledged
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -265,7 +331,9 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.STRING); // Name
|
||||
create(Type.BOOLEAN, false); // No public key - requiring this has to be disabled on the server
|
||||
// Write empty profile key and uuid - requires the enforce-secure-profiles option to be disabled on the server
|
||||
create(Type.OPTIONAL_PROFILE_KEY, null);
|
||||
create(Type.OPTIONAL_UUID, null);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -276,11 +344,16 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
create(Type.BOOLEAN, true); // Is nonce
|
||||
}
|
||||
});
|
||||
|
||||
cancelClientbound(ClientboundPackets1_19_1.CUSTOM_CHAT_COMPLETIONS); // Can't do anything with them unless we add clutter clients with fake player profiles
|
||||
cancelClientbound(ClientboundPackets1_19_1.DELETE_CHAT_MESSAGE); // Can't do without the old "send 50 empty lines and then resend previous messages" trick
|
||||
cancelClientbound(ClientboundPackets1_19_1.PLAYER_CHAT_HEADER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final UserConnection user) {
|
||||
user.put(new DimensionRegistryStorage());
|
||||
user.put(new ReceivedMessagesStorage());
|
||||
addEntityTracker(user, new EntityTrackerBase(user, Entity1_19Types.PLAYER, true));
|
||||
}
|
||||
|
||||
@@ -304,30 +377,70 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
|
||||
return blockItemPackets;
|
||||
}
|
||||
|
||||
private TextReplacementConfig replace(final JsonElement replacement) {
|
||||
return TextReplacementConfig.builder().matchLiteral("%s").replacement(GsonComponentSerializer.gson().deserializeFromTree(replacement)).once().build();
|
||||
}
|
||||
private @Nullable JsonElement decorateChatMessage(final PacketWrapper wrapper, final int chatTypeId, final JsonElement senderName, @Nullable final JsonElement targetName, final JsonElement message) {
|
||||
translatableRewriter.processText(message);
|
||||
|
||||
private void handleChatType(final PacketWrapper wrapper, final JsonElement senderName, final JsonElement teamName, final JsonElement text) throws Exception {
|
||||
translatableRewriter.processText(text);
|
||||
|
||||
final byte type = wrapper.get(Type.BYTE, 0);
|
||||
if (type > 2) {
|
||||
wrapper.set(Type.BYTE, 0, (byte) 0); // Chat type
|
||||
CompoundTag chatType = wrapper.user().get(DimensionRegistryStorage.class).chatType(chatTypeId);
|
||||
if (chatType == null) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("Chat message has unknown chat type id " + chatTypeId + ". Message: " + message);
|
||||
return null;
|
||||
}
|
||||
|
||||
final String key = CHAT_KEYS[type];
|
||||
if (key != null) {
|
||||
Component component = Component.text(ViaBackwards.getConfig().chatTypeFormat(key));
|
||||
if (key.equals("chat.type.team.text")) {
|
||||
Preconditions.checkNotNull(teamName, "Team name is null");
|
||||
component = component.replaceText(replace(teamName));
|
||||
}
|
||||
if (senderName != null) {
|
||||
component = component.replaceText(replace(senderName));
|
||||
}
|
||||
component = component.replaceText(replace(text));
|
||||
wrapper.set(Type.COMPONENT, 0, GsonComponentSerializer.gson().serializeToTree(component));
|
||||
chatType = chatType.<CompoundTag>get("element").get("chat");
|
||||
if (chatType == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final String translationKey = (String) chatType.get("translation_key").getValue();
|
||||
final TranslatableComponent.Builder componentBuilder = Component.translatable().key(translationKey);
|
||||
|
||||
// Add the style
|
||||
final CompoundTag style = chatType.get("style");
|
||||
if (style != null) {
|
||||
final Style.Builder styleBuilder = Style.style();
|
||||
final StringTag color = style.get("color");
|
||||
if (color != null) {
|
||||
final NamedTextColor textColor = NamedTextColor.NAMES.value(color.getValue());
|
||||
if (textColor != null) {
|
||||
styleBuilder.color(NamedTextColor.NAMES.value(color.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
for (final String key : TextDecoration.NAMES.keys()) {
|
||||
if (style.contains(key)) {
|
||||
styleBuilder.decoration(TextDecoration.NAMES.value(key), style.<ByteTag>get(key).asByte() == 1);
|
||||
}
|
||||
}
|
||||
componentBuilder.style(styleBuilder.build());
|
||||
}
|
||||
|
||||
// Add the replacements
|
||||
final ListTag parameters = chatType.get("parameters");
|
||||
if (parameters != null) {
|
||||
final List<Component> arguments = new ArrayList<>();
|
||||
for (final Tag element : parameters) {
|
||||
JsonElement argument = null;
|
||||
switch ((String) element.getValue()) {
|
||||
case "sender":
|
||||
argument = senderName;
|
||||
break;
|
||||
case "content":
|
||||
argument = message;
|
||||
break;
|
||||
case "target":
|
||||
Preconditions.checkNotNull(targetName, "Target name is null");
|
||||
argument = targetName;
|
||||
break;
|
||||
default:
|
||||
ViaBackwards.getPlatform().getLogger().warning("Unknown parameter for chat decoration: " + element.getValue());
|
||||
}
|
||||
if (argument != null) {
|
||||
arguments.add(GsonComponentSerializer.gson().deserializeFromTree(argument));
|
||||
}
|
||||
}
|
||||
componentBuilder.args(arguments);
|
||||
}
|
||||
|
||||
return GsonComponentSerializer.gson().serializeToTree(componentBuilder.build());
|
||||
}
|
||||
}
|
||||
+28
-3
@@ -15,25 +15,35 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.data;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.data;
|
||||
|
||||
import com.viaversion.viabackwards.api.data.VBMappingDataLoader;
|
||||
import com.viaversion.viaversion.api.minecraft.nbt.BinaryTagIO;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import com.viaversion.viaversion.libs.gson.JsonArray;
|
||||
import com.viaversion.viaversion.libs.gson.JsonElement;
|
||||
import com.viaversion.viaversion.libs.gson.JsonObject;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.Protocol1_19To1_18_2;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings {
|
||||
|
||||
private String[] argumentTypes;
|
||||
private final Int2ObjectMap<CompoundTag> defaultChatTypes = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public BackwardsMappings() {
|
||||
super("1.19", "1.18", Protocol1_19To1_18_2.class, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadExtras(final JsonObject oldMappings, final JsonObject newMappings, @Nullable final JsonObject diffMappings) {
|
||||
super.loadExtras(oldMappings, newMappings, diffMappings);
|
||||
protected void loadVBExtras(final JsonObject oldMappings, final JsonObject newMappings) {
|
||||
int i = 0;
|
||||
final JsonArray types = oldMappings.getAsJsonArray("argumenttypes");
|
||||
this.argumentTypes = new String[types.size()];
|
||||
@@ -41,9 +51,24 @@ public final class BackwardsMappings extends com.viaversion.viabackwards.api.dat
|
||||
final String id = element.getAsString();
|
||||
this.argumentTypes[i++] = id;
|
||||
}
|
||||
|
||||
try {
|
||||
ListTag chatTypes = BinaryTagIO.readCompressedInputStream(VBMappingDataLoader.getResource("chat-types-1.19.1.nbt")).get("values");
|
||||
for (final Tag chatType : chatTypes) {
|
||||
final CompoundTag chatTypeCompound = (CompoundTag) chatType;
|
||||
final NumberTag idTag = chatTypeCompound.get("id");
|
||||
defaultChatTypes.put(idTag.asInt(), chatTypeCompound);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public @Nullable String argumentType(final int argumentTypeId) {
|
||||
return argumentTypeId >= 0 && argumentTypeId < argumentTypes.length ? argumentTypes[argumentTypeId] : null;
|
||||
}
|
||||
|
||||
public @Nullable CompoundTag chatType(final int id) {
|
||||
return defaultChatTypes.get(id);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.data;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.data;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
+48
-22
@@ -15,29 +15,30 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.packets;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.packets;
|
||||
|
||||
import com.viaversion.viabackwards.api.rewriters.ItemRewriter;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.Protocol1_18_2To1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.Protocol1_18_2To1_19_1;
|
||||
import com.viaversion.viaversion.api.data.ParticleMappings;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.DataPalette;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.PaletteType;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.data.RecipeRewriter1_16;
|
||||
import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.ServerboundPackets1_17;
|
||||
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.types.Chunk1_18Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ClientboundPackets1_19_1;
|
||||
import com.viaversion.viaversion.rewriter.BlockRewriter;
|
||||
import com.viaversion.viaversion.util.MathUtil;
|
||||
|
||||
public final class BlockItemPackets1_19 extends ItemRewriter<Protocol1_18_2To1_19> {
|
||||
public final class BlockItemPackets1_19 extends ItemRewriter<Protocol1_18_2To1_19_1> {
|
||||
|
||||
public BlockItemPackets1_19(final Protocol1_18_2To1_19 protocol) {
|
||||
public BlockItemPackets1_19(final Protocol1_18_2To1_19_1 protocol) {
|
||||
super(protocol);
|
||||
}
|
||||
|
||||
@@ -45,32 +46,57 @@ public final class BlockItemPackets1_19 extends ItemRewriter<Protocol1_18_2To1_1
|
||||
protected void registerPackets() {
|
||||
final BlockRewriter blockRewriter = new BlockRewriter(protocol, Type.POSITION1_14);
|
||||
|
||||
new RecipeRewriter1_16(protocol).registerDefaultHandler(ClientboundPackets1_19.DECLARE_RECIPES);
|
||||
new RecipeRewriter1_16(protocol).registerDefaultHandler(ClientboundPackets1_19_1.DECLARE_RECIPES);
|
||||
|
||||
registerSetCooldown(ClientboundPackets1_19.COOLDOWN);
|
||||
registerWindowItems1_17_1(ClientboundPackets1_19.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerSetSlot1_17_1(ClientboundPackets1_19.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerEntityEquipmentArray(ClientboundPackets1_19.ENTITY_EQUIPMENT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerTradeList(ClientboundPackets1_19.TRADE_LIST, Type.FLAT_VAR_INT_ITEM);
|
||||
registerAdvancements(ClientboundPackets1_19.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
|
||||
registerSetCooldown(ClientboundPackets1_19_1.COOLDOWN);
|
||||
registerWindowItems1_17_1(ClientboundPackets1_19_1.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerSetSlot1_17_1(ClientboundPackets1_19_1.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerEntityEquipmentArray(ClientboundPackets1_19_1.ENTITY_EQUIPMENT, Type.FLAT_VAR_INT_ITEM);
|
||||
registerAdvancements(ClientboundPackets1_19_1.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
|
||||
registerClickWindow1_17_1(ServerboundPackets1_17.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
|
||||
|
||||
blockRewriter.registerBlockAction(ClientboundPackets1_19.BLOCK_ACTION);
|
||||
blockRewriter.registerBlockChange(ClientboundPackets1_19.BLOCK_CHANGE);
|
||||
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19.MULTI_BLOCK_CHANGE);
|
||||
blockRewriter.registerEffect(ClientboundPackets1_19.EFFECT, 1010, 2001);
|
||||
blockRewriter.registerBlockAction(ClientboundPackets1_19_1.BLOCK_ACTION);
|
||||
blockRewriter.registerBlockChange(ClientboundPackets1_19_1.BLOCK_CHANGE);
|
||||
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_1.MULTI_BLOCK_CHANGE);
|
||||
blockRewriter.registerEffect(ClientboundPackets1_19_1.EFFECT, 1010, 2001);
|
||||
|
||||
registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
|
||||
protocol.registerServerbound(ServerboundPackets1_17.EDIT_BOOK, new PacketRemapper() {
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.TRADE_LIST, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
|
||||
map(Type.VAR_INT); // Container id
|
||||
handler(wrapper -> {
|
||||
final int size = wrapper.read(Type.VAR_INT);
|
||||
wrapper.write(Type.UNSIGNED_BYTE, (short) size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // First item
|
||||
handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Result
|
||||
|
||||
final Item secondItem = wrapper.read(Type.FLAT_VAR_INT_ITEM);
|
||||
if (secondItem != null) {
|
||||
handleItemToClient(secondItem);
|
||||
wrapper.write(Type.BOOLEAN, true);
|
||||
wrapper.write(Type.FLAT_VAR_INT_ITEM, secondItem);
|
||||
} else {
|
||||
wrapper.write(Type.BOOLEAN, false);
|
||||
}
|
||||
|
||||
wrapper.passthrough(Type.BOOLEAN); // Out of stock
|
||||
wrapper.passthrough(Type.INT); // Uses
|
||||
wrapper.passthrough(Type.INT); // Max uses
|
||||
wrapper.passthrough(Type.INT); // Xp
|
||||
wrapper.passthrough(Type.INT); // Special price diff
|
||||
wrapper.passthrough(Type.FLOAT); // Price multiplier
|
||||
wrapper.passthrough(Type.INT); //Demand
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19.WINDOW_PROPERTY);
|
||||
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19_1.WINDOW_PROPERTY);
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.BLOCK_CHANGED_ACK, null, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.BLOCK_CHANGED_ACK, null, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
read(Type.VAR_INT); // Sequence
|
||||
@@ -78,7 +104,7 @@ public final class BlockItemPackets1_19 extends ItemRewriter<Protocol1_18_2To1_1
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.SPAWN_PARTICLE, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.SPAWN_PARTICLE, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT, Type.INT); // Particle id
|
||||
@@ -113,7 +139,7 @@ public final class BlockItemPackets1_19 extends ItemRewriter<Protocol1_18_2To1_1
|
||||
});
|
||||
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.CHUNK_DATA, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.CHUNK_DATA, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
+44
-44
@@ -15,12 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.packets;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.packets;
|
||||
|
||||
import com.viaversion.viabackwards.api.rewriters.EntityRewriter;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.Protocol1_18_2To1_19;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage.DimensionRegistryStorage;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage.StoredPainting;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.Protocol1_18_2To1_19_1;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage.DimensionRegistryStorage;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage.StoredPainting;
|
||||
import com.viaversion.viaversion.api.data.ParticleMappings;
|
||||
import com.viaversion.viaversion.api.data.entity.StoredEntityData;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
@@ -35,28 +35,26 @@ import com.viaversion.viaversion.api.type.types.version.Types1_18;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_19;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
|
||||
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPackets1_18;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ClientboundPackets1_19_1;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19_1> {
|
||||
|
||||
public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19> {
|
||||
|
||||
public EntityPackets1_19(final Protocol1_18_2To1_19 protocol) {
|
||||
public EntityPackets1_19(final Protocol1_18_2To1_19_1 protocol) {
|
||||
super(protocol);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
registerTracker(ClientboundPackets1_19.SPAWN_EXPERIENCE_ORB, Entity1_19Types.EXPERIENCE_ORB);
|
||||
registerTracker(ClientboundPackets1_19.SPAWN_PLAYER, Entity1_19Types.PLAYER);
|
||||
registerMetadataRewriter(ClientboundPackets1_19.ENTITY_METADATA, Types1_19.METADATA_LIST, Types1_18.METADATA_LIST);
|
||||
registerRemoveEntities(ClientboundPackets1_19.REMOVE_ENTITIES);
|
||||
registerTracker(ClientboundPackets1_19_1.SPAWN_EXPERIENCE_ORB, Entity1_19Types.EXPERIENCE_ORB);
|
||||
registerTracker(ClientboundPackets1_19_1.SPAWN_PLAYER, Entity1_19Types.PLAYER);
|
||||
registerMetadataRewriter(ClientboundPackets1_19_1.ENTITY_METADATA, Types1_19.METADATA_LIST, Types1_18.METADATA_LIST);
|
||||
registerRemoveEntities(ClientboundPackets1_19_1.REMOVE_ENTITIES);
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.SPAWN_ENTITY, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.SPAWN_ENTITY, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Entity id
|
||||
@@ -100,7 +98,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.ENTITY_EFFECT, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.ENTITY_EFFECT, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Entity id
|
||||
@@ -117,7 +115,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.JOIN_GAME, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.JOIN_GAME, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.INT); // Entity ID
|
||||
@@ -127,27 +125,45 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
map(Type.STRING_ARRAY); // Worlds
|
||||
map(Type.NBT); // Dimension registry
|
||||
handler(wrapper -> {
|
||||
final DimensionRegistryStorage dimensionRegistryStorage = wrapper.user().get(DimensionRegistryStorage.class);
|
||||
dimensionRegistryStorage.clear();
|
||||
|
||||
// Cache dimensions and find current dimension
|
||||
final String dimensionKey = wrapper.read(Type.STRING);
|
||||
final ListTag dimensions = ((CompoundTag) wrapper.get(Type.NBT, 0).get("minecraft:dimension_type")).get("value");
|
||||
final Map<String, CompoundTag> dimensionsMap = new HashMap<>(dimensions.size());
|
||||
final CompoundTag registry = wrapper.get(Type.NBT, 0);
|
||||
final ListTag dimensions = ((CompoundTag) registry.get("minecraft:dimension_type")).get("value");
|
||||
boolean found = false;
|
||||
for (final Tag dimension : dimensions) {
|
||||
final CompoundTag dimensionCompound = (CompoundTag) dimension;
|
||||
final StringTag nameTag = dimensionCompound.get("name");
|
||||
final CompoundTag dimensionData = dimensionCompound.get("element");
|
||||
dimensionsMap.put(nameTag.getValue(), dimensionData.clone());
|
||||
dimensionRegistryStorage.addDimension(nameTag.getValue(), dimensionData.clone());
|
||||
|
||||
if (!found && nameTag.getValue().equals(dimensionKey)) {
|
||||
wrapper.write(Type.NBT, dimensionData);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
throw new IllegalStateException("Could not find dimension " + dimensionKey + " in dimension registry");
|
||||
}
|
||||
|
||||
wrapper.user().get(DimensionRegistryStorage.class).setDimensions(dimensionsMap);
|
||||
// Add biome category and track biomes
|
||||
final CompoundTag biomeRegistry = registry.get("minecraft:worldgen/biome");
|
||||
final ListTag biomes = biomeRegistry.get("value");
|
||||
for (final Tag biome : biomes.getValue()) {
|
||||
final CompoundTag biomeCompound = ((CompoundTag) biome).get("element");
|
||||
biomeCompound.put("category", new StringTag("none"));
|
||||
}
|
||||
tracker(wrapper.user()).setBiomesSent(biomes.size());
|
||||
|
||||
// Cache and remove chat types
|
||||
final ListTag chatTypes = ((CompoundTag) registry.remove("minecraft:chat_type")).get("value");
|
||||
for (final Tag chatType : chatTypes) {
|
||||
final CompoundTag chatTypeCompound = (CompoundTag) chatType;
|
||||
final NumberTag idTag = chatTypeCompound.get("id");
|
||||
dimensionRegistryStorage.addChatType(idTag.asInt(), chatTypeCompound);
|
||||
}
|
||||
});
|
||||
map(Type.STRING); // World
|
||||
map(Type.LONG); // Seed
|
||||
@@ -161,24 +177,10 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
read(Type.OPTIONAL_GLOBAL_POSITION); // Read last death location
|
||||
handler(worldDataTrackerHandler(1));
|
||||
handler(playerTrackerHandler());
|
||||
handler(wrapper -> {
|
||||
final CompoundTag registry = wrapper.get(Type.NBT, 0);
|
||||
final CompoundTag biomeRegistry = registry.get("minecraft:worldgen/biome");
|
||||
final ListTag biomes = biomeRegistry.get("value");
|
||||
for (final Tag biome : biomes.getValue()) {
|
||||
final CompoundTag biomeCompound = ((CompoundTag) biome).get("element");
|
||||
biomeCompound.put("category", new StringTag("none"));
|
||||
}
|
||||
|
||||
registry.remove("minecraft:chat_type");
|
||||
|
||||
// Track amount of biomes sent
|
||||
tracker(wrapper.user()).setBiomesSent(biomes.size());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.RESPAWN, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.RESPAWN, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
@@ -202,7 +204,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_19.PLAYER_INFO, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets1_19_1.PLAYER_INFO, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
@@ -229,11 +231,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
}
|
||||
|
||||
// Remove public profile signature
|
||||
if (wrapper.read(Type.BOOLEAN)) {
|
||||
wrapper.read(Type.LONG); // Timestamp
|
||||
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Key
|
||||
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Signature
|
||||
}
|
||||
wrapper.read(Type.OPTIONAL_PROFILE_KEY);
|
||||
} else if (action == 1 || action == 2) { // Update gamemode/update latency
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
} else if (action == 3) { // Update display name
|
||||
@@ -305,7 +303,7 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
packet.write(Type.BYTE, storedPainting.direction());
|
||||
try {
|
||||
// TODO Race condition
|
||||
packet.send(Protocol1_18_2To1_19.class);
|
||||
packet.send(Protocol1_18_2To1_19_1.class);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -325,6 +323,8 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
|
||||
filter().type(Entity1_19Types.WARDEN).cancel(16); // Anger
|
||||
mapEntityTypeWithData(Entity1_19Types.WARDEN, Entity1_19Types.IRON_GOLEM).jsonName();
|
||||
|
||||
filter().type(Entity1_19Types.ALLAY).cancel(16); // Dancing
|
||||
filter().type(Entity1_19Types.ALLAY).cancel(17); // Can duplicate
|
||||
mapEntityTypeWithData(Entity1_19Types.ALLAY, Entity1_19Types.VEX).jsonName();
|
||||
|
||||
filter().type(Entity1_19Types.GOAT).cancel(18);
|
||||
+22
-4
@@ -15,9 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage;
|
||||
|
||||
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.Protocol1_18_2To1_19_1;
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
@@ -26,15 +29,30 @@ import java.util.Map;
|
||||
|
||||
public final class DimensionRegistryStorage implements StorableObject {
|
||||
|
||||
private Map<String, CompoundTag> dimensions = new HashMap<>();
|
||||
private final Map<String, CompoundTag> dimensions = new HashMap<>();
|
||||
private final Int2ObjectMap<CompoundTag> chatTypes = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public @Nullable CompoundTag dimension(final String dimensionKey) {
|
||||
final CompoundTag compoundTag = dimensions.get(dimensionKey);
|
||||
return compoundTag != null ? compoundTag.clone() : null;
|
||||
}
|
||||
|
||||
public void setDimensions(final Map<String, CompoundTag> dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
public void addDimension(final String dimensionKey, final CompoundTag dimension) {
|
||||
dimensions.put(dimensionKey, dimension);
|
||||
}
|
||||
|
||||
public @Nullable CompoundTag chatType(final int id) {
|
||||
if (chatTypes.isEmpty()) return Protocol1_18_2To1_19_1.MAPPINGS.chatType(id);
|
||||
return chatTypes.get(id);
|
||||
}
|
||||
|
||||
public void addChatType(final int id, final CompoundTag chatType) {
|
||||
chatTypes.put(id, chatType);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
dimensions.clear();
|
||||
chatTypes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
|
||||
* Copyright (C) 2016-2022 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class ReceivedMessagesStorage implements StorableObject {
|
||||
private final PlayerMessageSignature[] signatures = new PlayerMessageSignature[5];
|
||||
private int size;
|
||||
private int unacknowledged;
|
||||
|
||||
public void add(final PlayerMessageSignature signature) {
|
||||
PlayerMessageSignature toPush = signature;
|
||||
for (int i = 0; i < this.size; ++i) {
|
||||
final PlayerMessageSignature entry = this.signatures[i];
|
||||
this.signatures[i] = toPush;
|
||||
toPush = entry;
|
||||
if (entry.uuid().equals(signature.uuid())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.size < this.signatures.length) {
|
||||
this.signatures[this.size++] = toPush;
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerMessageSignature[] lastSignatures() {
|
||||
return Arrays.copyOf(this.signatures, size);
|
||||
}
|
||||
|
||||
public int tickUnacknowledged() {
|
||||
return unacknowledged++;
|
||||
}
|
||||
|
||||
public void resetUnacknowledgedCount() {
|
||||
unacknowledged = 0;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage;
|
||||
package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19_1.storage;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
@@ -21,10 +21,12 @@ fix-formatted-inventory-titles: true
|
||||
# This only takes effect for ids in the short range. Useful for anticheat compatibility.
|
||||
handle-pings-as-inv-acknowledgements: false
|
||||
#
|
||||
# Chat type formats used for sub 1.19 clients.
|
||||
chat-types:
|
||||
# 1.19.1 chat type formats.
|
||||
chat-types-1_19_1:
|
||||
"chat.type.text": "<%s> %s"
|
||||
"chat.type.announcement": "[%s] %s"
|
||||
"commands.message.display.incoming": "%s whispers to you: %s"
|
||||
"commands.message.display.outgoing": "You whisper to %s: %s"
|
||||
"chat.type.team.text": "%s <%s> %s"
|
||||
"chat.type.team.sent": "-> %s <%s> %s"
|
||||
"chat.type.emote": "* %s %s"
|
||||
Binary file not shown.
@@ -442,7 +442,7 @@
|
||||
"entity.frog.lay_spawn": "",
|
||||
"entity.frog.long_jump": "",
|
||||
"entity.frog.step": "",
|
||||
"entity.frog.tounge": "",
|
||||
"entity.frog.tongue": "",
|
||||
"block.mangrove_roots.break": "",
|
||||
"block.mangrove_roots.fall": "",
|
||||
"block.mangrove_roots.hit": "",
|
||||
|
||||
@@ -1,5 +1,80 @@
|
||||
{
|
||||
"1.19": {
|
||||
"1.19.1": {
|
||||
"gui.acknowledge": "Acknowledge",
|
||||
"gui.socialInteractions.report": "Report",
|
||||
"gui.socialInteractions.tooltip.report": "Report player",
|
||||
"gui.socialInteractions.tooltip.report.disabled": "Cannot create report: reporting service unavailable",
|
||||
"gui.socialInteractions.tooltip.report.no_messages": "Cannot create report: no recent messages from player %s",
|
||||
"gui.socialInteractions.narration.hide": "Hide messages from %s",
|
||||
"gui.socialInteractions.narration.show": "Show messages from %s",
|
||||
"gui.socialInteractions.narration.report": "Report player %s",
|
||||
"gui.chatReport.title": "Report Player",
|
||||
"gui.chatReport.send": "Send Report",
|
||||
"gui.chatReport.send.comments_too_long": "Please shorten the comment",
|
||||
"gui.chatReport.send.no_reason": "Please select a report category",
|
||||
"gui.chatReport.send.no_reported_messages": "Please select at least one chat message to report",
|
||||
"gui.chatReport.send.too_many_messages": "Trying to include too many messages in the report",
|
||||
"gui.chatReport.observed_what": "Why are you reporting this?",
|
||||
"gui.chatReport.select_reason": "Select Report Category",
|
||||
"gui.chatReport.more_comments": "Please describe what happened:",
|
||||
"gui.chatReport.describe": "Sharing details will help us make a well-informed decision.",
|
||||
"gui.chatReport.comments": "Comments edit box",
|
||||
"gui.chatReport.read_info": "Learn About Reporting",
|
||||
"gui.chatReport.select_chat": "Select Chat Messages to Report",
|
||||
"gui.chatReport.selected_chat": "%s Chat Message(s) Selected to Report",
|
||||
"gui.chatReport.report_sent_msg": "We�ve successfully received your report. Thank you!\n\nOur team will review it as soon as possible.",
|
||||
"gui.chatReport.discard.title": "Discard report and comments?",
|
||||
"gui.chatReport.discard.content": "If you leave, you'll lose this report and your comments.\nAre you sure you want to leave?",
|
||||
"gui.chatReport.discard.discard": "Leave and Discard Report",
|
||||
"gui.chatReport.discard.return": "Continue Editing",
|
||||
"gui.abuseReport.reason.title": "Select Report Category",
|
||||
"gui.abuseReport.reason.description": "Description:",
|
||||
"gui.abuseReport.reason.narration": "%s: %s",
|
||||
"gui.abuseReport.reason.false_reporting": "False Reporting",
|
||||
"gui.abuseReport.reason.child_sexual_exploitation_or_abuse": "Child sexual exploitation or abuse",
|
||||
"gui.abuseReport.reason.child_sexual_exploitation_or_abuse.description": "Someone is talking about or otherwise promoting indecent behavior involving children.",
|
||||
"gui.abuseReport.reason.terrorism_or_violent_extremism": "Terrorism or violent extremism",
|
||||
"gui.abuseReport.reason.terrorism_or_violent_extremism.description": "Someone is talking about, promoting, or threatening to commit acts of terrorism or violent extremism for political, religious, ideological, or other reasons.",
|
||||
"gui.abuseReport.reason.hate_speech": "Hate speech",
|
||||
"gui.abuseReport.reason.hate_speech.description": "Someone is attacking you or another player based on characteristics of their identity, like religion, race, or sexuality.",
|
||||
"gui.abuseReport.reason.harassment_or_bullying": "Harassment or bullying",
|
||||
"gui.abuseReport.reason.harassment_or_bullying.description": "Someone is shaming, attacking, or bullying you or someone else. This includes when someone is repeatedly trying to contact you or someone else without consent or posting private personal information about you or someone else without consent (\"doxing\").",
|
||||
"gui.abuseReport.reason.imminent_harm": "Imminent harm - Threat to harm others",
|
||||
"gui.abuseReport.reason.imminent_harm.description": "Someone is threatening to harm you or someone else in real life.",
|
||||
"gui.abuseReport.reason.defamation_impersonation_false_information": "Defamation, impersonation, or false information",
|
||||
"gui.abuseReport.reason.defamation_impersonation_false_information.description": "Someone is damaging someone else's reputation, pretending to be someone they're not, or sharing false information with the aim to exploit or mislead others.",
|
||||
"gui.abuseReport.reason.self_harm_or_suicide": "Imminent harm - Self-harm or suicide",
|
||||
"gui.abuseReport.reason.self_harm_or_suicide.description": "Someone is threatening to harm themselves in real life or talking about harming themselves in real life.",
|
||||
"gui.abuseReport.reason.alcohol_tobacco_drugs": "Drugs or alcohol",
|
||||
"gui.abuseReport.reason.alcohol_tobacco_drugs.description": "Someone is encouraging others to partake in illegal drug related activities or encouraging underage drinking.",
|
||||
"gui.abuseReport.reason.non_consensual_intimate_imagery": "Non-consensual intimate imagery",
|
||||
"gui.abuseReport.reason.non_consensual_intimate_imagery.description": "Someone is talking about, sharing, or otherwise promoting private and intimate images.",
|
||||
"gui.abuseReport.sending.title": "Sending your report...",
|
||||
"gui.abuseReport.sent.title": "Report sent",
|
||||
"gui.abuseReport.error.title": "Problem sending your report",
|
||||
"gui.abuseReport.send.generic_error": "Encountered an unexpected error while sending your report.",
|
||||
"gui.abuseReport.send.error_message": "An error was returned while sending your report:\n'%s'",
|
||||
"gui.abuseReport.send.service_unavailable": "Unable to reach the Abuse Reporting service. Please make sure you are connected to the internet and try again.",
|
||||
"gui.abuseReport.send.http_error": "An unexpected HTTP error occurred while sending your report.",
|
||||
"gui.abuseReport.send.json_error": "Encountered malformed payload while sending your report.",
|
||||
"gui.chatSelection.title": "Select Chat Messages to Report",
|
||||
"gui.chatSelection.context": "Messages surrounding this selection will be included to provide additional context",
|
||||
"gui.chatSelection.selected": "%s/%s message(s) selected",
|
||||
"gui.chatSelection.heading": "%s %s",
|
||||
"gui.chatSelection.message.narrate": "%s said: %s at %s",
|
||||
"gui.chatSelection.fold": "%s unrelated messages hidden",
|
||||
"gui.multiLineEditBox.character_limit": "%s/%s",
|
||||
"gui.banned.title.temporary": "Account temporarily suspended",
|
||||
"gui.banned.title.permanent": "Account permanently banned",
|
||||
"gui.banned.description": "%s\n\n%s\n\nLearn more at the following link: %s",
|
||||
"gui.banned.description.reason": "We recently received a report for bad behavior by your account. Our moderators have now reviewed your case and identified it as %s, which goes against the Minecraft Community Standards.",
|
||||
"gui.banned.description.reason_id": "Code: %s",
|
||||
"gui.banned.description.reason_id_message": "Code: %s - %s",
|
||||
"gui.banned.description.unknownreason": "We recently received a report for bad behavior by your account. Our moderators have now reviewed your case and identified that it goes against the Minecraft Community Standards.",
|
||||
"gui.banned.description.temporary.duration": "Your account is temporarily suspended and will be reactivated in %s.",
|
||||
"gui.banned.description.temporary": "%s Until then, you can�t play online or join Realms.",
|
||||
"gui.banned.description.permanent": "Your account is permanently banned, which means you can�t play online or join Realms.",
|
||||
"menu.playerReporting": "Player Reporting",
|
||||
"selectWorld.loading_list": "Loading world list",
|
||||
"flat_world_preset.unknown": "???",
|
||||
"flat_world_preset.minecraft.classic_flat": "Classic Flat",
|
||||
@@ -21,11 +96,38 @@
|
||||
"multiplayer.disconnect.missing_public_key": "Missing profile public key.\nThis server requires secure profiles.",
|
||||
"multiplayer.disconnect.invalid_public_key_signature": "Invalid signature for profile public key.\nTry restarting your game.",
|
||||
"multiplayer.disconnect.invalid_public_key": "Unable to parse profile public key.",
|
||||
"multiplayer.disconnect.out_of_order_chat": "Out-of-order chat packet received. Did your system time change?",
|
||||
"multiplayer.disconnect.unsigned_chat": "Received chat packet with missing or invalid signature.",
|
||||
"multiplayer.disconnect.too_many_pending_chats": "Too many unacknowledged chat messages",
|
||||
"multiplayer.disconnect.chat_validation_failed": "Chat message validation failure",
|
||||
"multiplayer.unsecureserver.toast.title": "Chat messages can't be verified",
|
||||
"multiplayer.unsecureserver.toast": "Messages sent on this server may be modified and might not reflect the original message",
|
||||
"chatPreview.warning.title": "This server uses Chat Preview",
|
||||
"chatPreview.warning.content": "Chat Preview allows the server to see your messages before they are sent to other players. This allows a server to send you a preview of your chat messages with custom modifications and styling applied.\n\nThe Chat Preview behavior can be changed in your Chat Settings. Current setting is: [%s]",
|
||||
"chatPreview.warning.check": "Do not notify again for this server",
|
||||
"chatPreview.warning.toast.title": "Chat Preview is enabled",
|
||||
"chatPreview.warning.toast": "This server uses Chat Preview and can see your messages as you type them, even before they're sent. You can turn this off in Chat Settings.",
|
||||
"chat.disabled.profile.moreInfo": "Chat not allowed by account settings. Cannot send or view messages.",
|
||||
"chat.previewInput": "Press [%s] to preview",
|
||||
"chat.tag.not_secure": "This message is not secure, which means that it might have been modified by the server",
|
||||
"chat.tag.modified": "This message has been modified by the server.",
|
||||
"chat.tag.modified.original": "Original text: %s",
|
||||
"disconnect.loginFailedInfo.userBanned": "You are banned from playing online",
|
||||
"options.darknessEffectScale": "Darkness Pulsing",
|
||||
"options.darknessEffectScale.tooltip": "Controls how much the Darkness effect pulses when a Warden or Sculk Shrieker gives it to you.",
|
||||
"options.chatPreview": "Chat Preview",
|
||||
"options.chatPreview.live": "While Typing",
|
||||
"options.chatPreview.confirm": "When Sending",
|
||||
"options.chatPreview.tooltip.off": "Any modifications applied to your chat messages by a server will not be previewed and will be treated as insecure.",
|
||||
"options.chatPreview.tooltip.live": "If a server uses Chat Previews: Any modifications applied to your chat messages by a server will be dynamically sent for previewing as the chat message is typed.",
|
||||
"options.chatPreview.tooltip.confirm": "If a server uses Chat Previews: A chat preview is only generated when attempting to send a message that does not have a preview or is waiting for a preview.\nSending the message requires confirmation.",
|
||||
"options.onlyShowSecureChat": "Only Show Secure Chat",
|
||||
"options.onlyShowSecureChat.tooltip": "Only display messages from other players that can be verified to have been sent by that player, and have not been modified.",
|
||||
"options.directionalAudio": "Directional Audio",
|
||||
"options.directionalAudio.on.tooltip": "Uses HRTF-based directional audio to improve the simulation of 3D sound. Requires HRTF compatible audio hardware, and is best experienced with headphones.",
|
||||
"options.directionalAudio.off.tooltip": "Classic Stereo sound",
|
||||
"title.multiplayer.disabled.banned.temporary": "Your account is temporarily suspended from online play",
|
||||
"title.multiplayer.disabled.banned.permanent": "Your account is permanently suspended from online play",
|
||||
"block.minecraft.mangrove_planks": "Mangrove Planks",
|
||||
"block.minecraft.mangrove_propagule": "Mangrove Propagule",
|
||||
"block.minecraft.mangrove_door": "Mangrove Door",
|
||||
@@ -69,10 +171,10 @@
|
||||
"item.minecraft.acacia_chest_boat": "Acacia Boat with Chest",
|
||||
"item.minecraft.dark_oak_chest_boat": "Dark Oak Boat with Chest",
|
||||
"item.minecraft.mangrove_boat": "Mangrove Boat",
|
||||
"item.minecraft.mangrove_chest_boat": "Mangrove Boat with Chest",
|
||||
"item.minecraft.recovery_compass": "Recovery Compass",
|
||||
"item.minecraft.music_disc_5": "Music Disc",
|
||||
"item.minecraft.music_disc_5.desc": "Samuel Åberg - 5",
|
||||
"item.minecraft.mangrove_chest_boat": "Mangrove Boat with Chest",
|
||||
"item.minecraft.disc_fragment_5": "Disc Fragment",
|
||||
"item.minecraft.disc_fragment_5.desc": "Music Disc - 5",
|
||||
"item.minecraft.allay_spawn_egg": "Allay Spawn Egg",
|
||||
@@ -94,11 +196,20 @@
|
||||
"entity.minecraft.frog": "Frog",
|
||||
"entity.minecraft.tadpole": "Tadpole",
|
||||
"entity.minecraft.warden": "Warden",
|
||||
"death.attack.onFire.item": "%1$s was burnt to a crisp whilst fighting %2$s wielding %3$s",
|
||||
"death.attack.witherSkull.item": "%1$s was shot by a skull from %2$s using %3$s",
|
||||
"death.attack.sonic_boom": "%1$s was obliterated by a sonically-charged shriek",
|
||||
"death.attack.sonic_boom.item": "%1$s was obliterated by a sonically-charged shriek whilst trying to escape %2$s wielding %3$s",
|
||||
"death.attack.sonic_boom.player": "%1$s was obliterated by a sonically-charged shriek whilst trying to escape %2$s",
|
||||
"death.attack.sting.item": "%1$s was stung to death by %2$s using %3$s",
|
||||
"effect.minecraft.darkness": "Darkness",
|
||||
"enchantment.minecraft.swift_sneak": "Swift Sneak",
|
||||
"gui.minutes": "%s minute(s)",
|
||||
"gui.hours": "%s hour(s)",
|
||||
"gui.days": "%s day(s)",
|
||||
"subtitles.block.frogspawn.hatch": "Tadpole hatches",
|
||||
"subtitles.block.sculk.charge": "Sculk bubbles",
|
||||
"subtitles.block.sculk.spread": "Sculk spreads",
|
||||
"subtitles.block.sculk_catalyst.bloom": "Sculk Catalyst blooms",
|
||||
"subtitles.block.sculk_shrieker.shriek": "Sculk Shrieker shrieks",
|
||||
"subtitles.entity.allay.death": "Allay dies",
|
||||
@@ -114,7 +225,7 @@
|
||||
"subtitles.entity.frog.hurt": "Frog hurts",
|
||||
"subtitles.entity.frog.lay_spawn": "Frog lays spawn",
|
||||
"subtitles.entity.frog.long_jump": "Frog jumps",
|
||||
"subtitles.entity.goat.horn_break": "Goat horn breaks off",
|
||||
"subtitles.entity.goat.horn_break": "Goat Horn breaks off",
|
||||
"subtitles.entity.parrot.imitate.warden": "Parrot whines",
|
||||
"subtitles.entity.tadpole.death": "Tadpole dies",
|
||||
"subtitles.entity.tadpole.flop": "Tadpole flops",
|
||||
@@ -139,7 +250,8 @@
|
||||
"subtitles.entity.warden.nearby_closest": "Warden draws close",
|
||||
"subtitles.entity.warden.sonic_charge": "Warden charges",
|
||||
"subtitles.entity.warden.sonic_boom": "Warden booms",
|
||||
"subtitles.item.goat_horn.play": "Goat horn plays",
|
||||
"subtitles.item.bucket.fill_tadpole": "Tadpole captured",
|
||||
"subtitles.item.goat_horn.play": "Goat Horn plays",
|
||||
"advancements.adventure.avoid_vibration.title": "Sneak 100",
|
||||
"advancements.adventure.avoid_vibration.description": "Sneak near a Sculk Sensor or Warden to prevent it from detecting you",
|
||||
"advancements.adventure.kill_mob_near_sculk_catalyst.title": "It Spreads",
|
||||
@@ -153,7 +265,17 @@
|
||||
"advancements.husbandry.allay_deliver_item_to_player.title": "You've Got a Friend in Me",
|
||||
"advancements.husbandry.allay_deliver_item_to_player.description": "Have an Allay deliver items to you",
|
||||
"advancements.husbandry.allay_deliver_cake_to_note_block.title": "Birthday Song",
|
||||
"advancements.husbandry.allay_deliver_cake_to_note_block.description": "Have an Allay drop a cake at a Note Block",
|
||||
"advancements.husbandry.allay_deliver_cake_to_note_block.description": "Have an Allay drop a Cake at a Note Block",
|
||||
"argument.enum.invalid": "Invalid value \"%s\"",
|
||||
"commands.locate.structure.success": "The nearest %s is at %s (%s blocks away)",
|
||||
"commands.locate.structure.not_found": "Could not find a structure of type \"%s\" nearby",
|
||||
"commands.locate.structure.invalid": "There is no structure with type \"%s\"",
|
||||
"commands.locate.biome.success": "The nearest %s is at %s (%s blocks away)",
|
||||
"commands.locate.biome.not_found": "Could not find a biome of type \"%s\" within reasonable distance",
|
||||
"commands.locate.biome.invalid": "There is no biome with type \"%s\"",
|
||||
"commands.locate.poi.success": "The nearest %s is at %s (%s blocks away)",
|
||||
"commands.locate.poi.not_found": "Could not find a point of interest of type \"%s\" within reasonable distance",
|
||||
"commands.locate.poi.invalid": "There is no point of interest with type \"%s\"",
|
||||
"commands.place.feature.failed": "Failed to place feature",
|
||||
"commands.place.feature.invalid": "There is no feature with type \"%s\"",
|
||||
"commands.place.feature.success": "Placed \"%s\" at %s, %s, %s",
|
||||
@@ -163,6 +285,9 @@
|
||||
"commands.place.structure.failed": "Failed to place structure",
|
||||
"commands.place.structure.invalid": "There is no structure with type \"%s\"",
|
||||
"commands.place.structure.success": "Generated structure \"%s\" at %s, %s, %s",
|
||||
"commands.place.template.failed": "Failed to place template",
|
||||
"commands.place.template.invalid": "There is no template with id \"%s\"",
|
||||
"commands.place.template.success": "Loaded template \"%s\" at %s, %s, %s",
|
||||
"biome.minecraft.deep_dark": "Deep Dark",
|
||||
"biome.minecraft.mangrove_swamp": "Mangrove Swamp",
|
||||
"gamerule.doWardenSpawning": "Spawn Wardens",
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
# ViaVersion
|
||||
viaver = "4.3.0-1.19-rc2-SNAPSHOT"
|
||||
viaver = "4.4.1"
|
||||
|
||||
# Common provided
|
||||
netty = "4.0.20.Final"
|
||||
|
||||
Reference in new issue
Block a user