Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +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
|
||||
|
||||
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
|
||||
|
||||
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||
@ -88,4 +88,4 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_9_3, Serv
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
@ -47,7 +47,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_9_3, Serv
|
||||
map(Type.STRING); // 0 - Channel
|
||||
|
||||
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
|
||||
|
||||
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||
@ -135,4 +135,4 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_9_3, Serv
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
@ -99,7 +99,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
|
||||
handler(wrapper -> {
|
||||
String channel = wrapper.get(Type.STRING, 0);
|
||||
// Handle stopsound change
|
||||
if (channel.equalsIgnoreCase("MC|StopSound")) {
|
||||
if (channel.equals("MC|StopSound")) {
|
||||
String originalSource = 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
|
||||
return;
|
||||
} else if (channel.equalsIgnoreCase("MC|TrList")) {
|
||||
} else if (channel.equals("MC|TrList")) {
|
||||
channel = "minecraft:trader_list";
|
||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||
|
||||
@ -773,4 +773,4 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
|
||||
|| id == 442 // shield
|
||||
|| id == 443; // elytra
|
||||
}
|
||||
}
|
||||
}
|
@ -265,9 +265,9 @@ public class PlayerPackets {
|
||||
map(Type.STRING); // 0 - Channel Name
|
||||
handler(wrapper -> {
|
||||
String name = wrapper.get(Type.STRING, 0);
|
||||
if (name.equalsIgnoreCase("MC|BOpen")) {
|
||||
if (name.equals("MC|BOpen")) {
|
||||
wrapper.write(Type.VAR_INT, 0);
|
||||
} else if (name.equalsIgnoreCase("MC|TrList")) {
|
||||
} else if (name.equals("MC|TrList")) {
|
||||
wrapper.passthrough(Type.INT); // ID
|
||||
|
||||
Short size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||
@ -406,14 +406,14 @@ public class PlayerPackets {
|
||||
map(Type.STRING); // 0 - Channel Name
|
||||
handler(wrapper -> {
|
||||
String name = wrapper.get(Type.STRING, 0);
|
||||
if (name.equalsIgnoreCase("MC|BSign")) {
|
||||
if (name.equals("MC|BSign")) {
|
||||
Item item = wrapper.passthrough(Type.ITEM1_8);
|
||||
if (item != null) {
|
||||
item.setIdentifier(387); // Written Book
|
||||
ItemRewriter.rewriteBookToServer(item);
|
||||
}
|
||||
}
|
||||
if (name.equalsIgnoreCase("MC|AutoCmd")) {
|
||||
if (name.equals("MC|AutoCmd")) {
|
||||
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
||||
wrapper.write(Type.BYTE, (byte) 0);
|
||||
wrapper.passthrough(Type.INT); // X
|
||||
@ -423,7 +423,7 @@ public class PlayerPackets {
|
||||
wrapper.passthrough(Type.BOOLEAN); // Flag
|
||||
wrapper.clearInputBuffer();
|
||||
}
|
||||
if (name.equalsIgnoreCase("MC|AdvCmd")) {
|
||||
if (name.equals("MC|AdvCmd")) {
|
||||
wrapper.set(Type.STRING, 0, "MC|AdvCdm");
|
||||
}
|
||||
});
|
||||
@ -489,4 +489,4 @@ public class PlayerPackets {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren