Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 09:00:09 +01:00
Use equals in legacy custom payload channel comparisons (#3721)
Dieser Commit ist enthalten in:
Ursprung
aa262bb0a5
Commit
4cf271af81
@ -45,7 +45,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_9_3, Serv
|
|||||||
map(Type.STRING); // 0 - Channel
|
map(Type.STRING); // 0 - Channel
|
||||||
|
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equals("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
|
@ -47,7 +47,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_9_3, Serv
|
|||||||
map(Type.STRING); // 0 - Channel
|
map(Type.STRING); // 0 - Channel
|
||||||
|
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equals("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
|
@ -99,7 +99,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
|
|||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
String channel = wrapper.get(Type.STRING, 0);
|
String channel = wrapper.get(Type.STRING, 0);
|
||||||
// Handle stopsound change
|
// Handle stopsound change
|
||||||
if (channel.equalsIgnoreCase("MC|StopSound")) {
|
if (channel.equals("MC|StopSound")) {
|
||||||
String originalSource = wrapper.read(Type.STRING);
|
String originalSource = wrapper.read(Type.STRING);
|
||||||
String originalSound = wrapper.read(Type.STRING);
|
String originalSound = wrapper.read(Type.STRING);
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
|
|||||||
|
|
||||||
wrapper.set(Type.BYTE, 0, flags); // Update flags
|
wrapper.set(Type.BYTE, 0, flags); // Update flags
|
||||||
return;
|
return;
|
||||||
} else if (channel.equalsIgnoreCase("MC|TrList")) {
|
} else if (channel.equals("MC|TrList")) {
|
||||||
channel = "minecraft:trader_list";
|
channel = "minecraft:trader_list";
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
|
@ -265,9 +265,9 @@ public class PlayerPackets {
|
|||||||
map(Type.STRING); // 0 - Channel Name
|
map(Type.STRING); // 0 - Channel Name
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
String name = wrapper.get(Type.STRING, 0);
|
String name = wrapper.get(Type.STRING, 0);
|
||||||
if (name.equalsIgnoreCase("MC|BOpen")) {
|
if (name.equals("MC|BOpen")) {
|
||||||
wrapper.write(Type.VAR_INT, 0);
|
wrapper.write(Type.VAR_INT, 0);
|
||||||
} else if (name.equalsIgnoreCase("MC|TrList")) {
|
} else if (name.equals("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // ID
|
wrapper.passthrough(Type.INT); // ID
|
||||||
|
|
||||||
Short size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
Short size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
@ -406,14 +406,14 @@ public class PlayerPackets {
|
|||||||
map(Type.STRING); // 0 - Channel Name
|
map(Type.STRING); // 0 - Channel Name
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
String name = wrapper.get(Type.STRING, 0);
|
String name = wrapper.get(Type.STRING, 0);
|
||||||
if (name.equalsIgnoreCase("MC|BSign")) {
|
if (name.equals("MC|BSign")) {
|
||||||
Item item = wrapper.passthrough(Type.ITEM1_8);
|
Item item = wrapper.passthrough(Type.ITEM1_8);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.setIdentifier(387); // Written Book
|
item.setIdentifier(387); // Written Book
|
||||||
ItemRewriter.rewriteBookToServer(item);
|
ItemRewriter.rewriteBookToServer(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name.equalsIgnoreCase("MC|AutoCmd")) {
|
if (name.equals("MC|AutoCmd")) {
|
||||||
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
||||||
wrapper.write(Type.BYTE, (byte) 0);
|
wrapper.write(Type.BYTE, (byte) 0);
|
||||||
wrapper.passthrough(Type.INT); // X
|
wrapper.passthrough(Type.INT); // X
|
||||||
@ -423,7 +423,7 @@ public class PlayerPackets {
|
|||||||
wrapper.passthrough(Type.BOOLEAN); // Flag
|
wrapper.passthrough(Type.BOOLEAN); // Flag
|
||||||
wrapper.clearInputBuffer();
|
wrapper.clearInputBuffer();
|
||||||
}
|
}
|
||||||
if (name.equalsIgnoreCase("MC|AdvCmd")) {
|
if (name.equals("MC|AdvCmd")) {
|
||||||
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren