Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
Finish mappings
Dieser Commit ist enthalten in:
Ursprung
9d3ee288df
Commit
808b1fd2f0
@ -30,7 +30,7 @@ import com.viaversion.viabackwards.protocol.protocol1_19_1to1_19_3.storage.Nonce
|
|||||||
import com.viaversion.viabackwards.protocol.protocol1_19to1_19_1.Protocol1_19To1_19_1;
|
import com.viaversion.viabackwards.protocol.protocol1_19to1_19_1.Protocol1_19To1_19_1;
|
||||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||||
import com.viaversion.viaversion.api.minecraft.ProfileKey;
|
import com.viaversion.viaversion.api.minecraft.ProfileKey;
|
||||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19Types;
|
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_3Types;
|
||||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||||
import com.viaversion.viaversion.api.rewriter.EntityRewriter;
|
import com.viaversion.viaversion.api.rewriter.EntityRewriter;
|
||||||
@ -285,12 +285,21 @@ public final class Protocol1_19_1To1_19_3 extends BackwardsProtocol<ClientboundP
|
|||||||
registerClientbound(ClientboundPackets1_19_3.DISGUISED_CHAT, ClientboundPackets1_19_1.SYSTEM_CHAT, new PacketRemapper() {
|
registerClientbound(ClientboundPackets1_19_3.DISGUISED_CHAT, ClientboundPackets1_19_1.SYSTEM_CHAT, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.COMPONENT);
|
handler(wrapper -> {
|
||||||
//TODO chat type handling
|
final JsonElement content = wrapper.read(Type.COMPONENT);
|
||||||
read(Type.VAR_INT); // Chat type
|
translatableRewriter.processText(content);
|
||||||
read(Type.COMPONENT); // Sender
|
final int chatTypeId = wrapper.read(Type.VAR_INT);
|
||||||
read(Type.OPTIONAL_COMPONENT); // Target
|
final JsonElement senderName = wrapper.read(Type.COMPONENT);
|
||||||
create(Type.BOOLEAN, false); // Overlay
|
final JsonElement targetName = wrapper.read(Type.OPTIONAL_COMPONENT);
|
||||||
|
final JsonElement result = Protocol1_19To1_19_1.decorateChatMessage(wrapper.user().get(ChatTypeStorage1_19_3.class), chatTypeId, senderName, targetName, content);
|
||||||
|
if (result == null) {
|
||||||
|
wrapper.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.write(Type.COMPONENT, result);
|
||||||
|
wrapper.write(Type.BOOLEAN, false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -303,7 +312,7 @@ public final class Protocol1_19_1To1_19_3 extends BackwardsProtocol<ClientboundP
|
|||||||
public void init(final UserConnection user) {
|
public void init(final UserConnection user) {
|
||||||
user.put(new ChatSessionStorage());
|
user.put(new ChatSessionStorage());
|
||||||
user.put(new ChatTypeStorage1_19_3());
|
user.put(new ChatTypeStorage1_19_3());
|
||||||
addEntityTracker(user, new EntityTrackerBase(user, Entity1_19Types.PLAYER, true));
|
addEntityTracker(user, new EntityTrackerBase(user, Entity1_19_3Types.PLAYER, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren