Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
Fix component length read
Dieser Commit ist enthalten in:
Ursprung
8294f6af4f
Commit
b506060e48
@ -50,7 +50,7 @@ public class TranslatableRewriter {
|
||||
protocol.registerOutgoing(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class TranslatableRewriter {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class TranslatableRewriter {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class TranslatableRewriter {
|
||||
handler(wrapper -> {
|
||||
int action = wrapper.get(Type.VAR_INT, 0);
|
||||
if (action == 0 || action == 3) {
|
||||
wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -95,7 +95,7 @@ public class TranslatableRewriter {
|
||||
public void registerMap() {
|
||||
map(Type.UNSIGNED_BYTE); // Id
|
||||
map(Type.STRING); // Window Type
|
||||
handler(wrapper -> wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class TranslatableRewriter {
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Id
|
||||
map(Type.VAR_INT); // Window Type
|
||||
handler(wrapper -> wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -119,7 +119,7 @@ public class TranslatableRewriter {
|
||||
if (wrapper.passthrough(Type.VAR_INT) == 2) {
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
wrapper.passthrough(Type.INT);
|
||||
wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -133,7 +133,7 @@ public class TranslatableRewriter {
|
||||
handler(wrapper -> {
|
||||
int action = wrapper.passthrough(Type.VAR_INT);
|
||||
if (action >= 0 && action <= 2) {
|
||||
wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -145,8 +145,8 @@ public class TranslatableRewriter {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.STRING, processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -137,7 +137,7 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
|
||||
|
||||
wrapper.write(Type.STRING, stringType);
|
||||
|
||||
String title = wrapper.read(Type.STRING);
|
||||
String title = wrapper.read(Type.COMPONENT_STRING);
|
||||
if (containerTitle != null) {
|
||||
// Don't rewrite renamed, only translatable titles
|
||||
JsonObject object = GsonUtil.getGson().fromJson(title, JsonObject.class);
|
||||
@ -148,7 +148,7 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
|
||||
}
|
||||
}
|
||||
}
|
||||
wrapper.write(Type.STRING, title);
|
||||
wrapper.write(Type.COMPONENT_STRING, title);
|
||||
|
||||
wrapper.write(Type.UNSIGNED_BYTE, (short) slotSize);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
int action = wrapper.get(Type.VAR_INT, 0);
|
||||
if (action == 0 || action == 3) {
|
||||
wrapper.write(Type.STRING, translatableRewriter.processText(wrapper.read(Type.STRING)));
|
||||
wrapper.write(Type.COMPONENT_STRING, translatableRewriter.processText(wrapper.read(Type.COMPONENT_STRING)));
|
||||
if (action == 0) {
|
||||
wrapper.passthrough(Type.FLOAT);
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
|
@ -53,7 +53,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
|
||||
registerOutgoing(ClientboundPackets1_16.CHAT_MESSAGE, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> wrapper.write(Type.STRING, translatableRewriter.processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, translatableRewriter.processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
map(Type.BYTE);
|
||||
map(Type.UUID, Type.NOTHING); // Sender
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Window Id
|
||||
map(Type.VAR_INT); // Window Type
|
||||
handler(wrapper -> wrapper.write(Type.STRING, translatableRewriter.processText(wrapper.read(Type.STRING))));
|
||||
handler(wrapper -> wrapper.write(Type.COMPONENT_STRING, translatableRewriter.processText(wrapper.read(Type.COMPONENT_STRING))));
|
||||
handler(wrapper -> {
|
||||
int windowType = wrapper.get(Type.VAR_INT, 1);
|
||||
if (windowType == 20) { // Smithing table
|
||||
|
2
pom.xml
2
pom.xml
@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>us.myles</groupId>
|
||||
<artifactId>viaversion</artifactId>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
<version>3.0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren