3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-09 01:30:13 +01:00

Fix team packet

Dieser Commit ist enthalten in:
Myles 2016-03-25 22:02:25 +00:00
Ursprung 406500b0bd
Commit 71a9c90fe9

Datei anzeigen

@ -90,28 +90,28 @@ public class PlayerPackets {
protocol.registerOutgoing(State.PLAY, 0x3E, 0x41, new PacketRemapper() { protocol.registerOutgoing(State.PLAY, 0x3E, 0x41, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.STRING); map(Type.STRING); // 0 - Team Name
map(Type.BYTE); map(Type.BYTE); // 1 - Mode
handler(new PacketHandler() { handler(new PacketHandler() {
@Override @Override
public void handle(PacketWrapper wrapper) throws Exception { public void handle(PacketWrapper wrapper) throws Exception {
byte mode = wrapper.get(Type.BYTE, 1); byte mode = wrapper.get(Type.BYTE, 0); // Mode
if (mode == 0 || mode == 2) { if (mode == 0 || mode == 2) {
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING); // Display Name
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING); // Prefix
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING); // Suffix
wrapper.passthrough(Type.BYTE); wrapper.passthrough(Type.BYTE); // Friendly Fire
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING); // Name tag visibility
wrapper.write(Type.STRING, ViaVersion.getConfig().isPreventCollision() ? "never" : ""); wrapper.write(Type.STRING, ViaVersion.getConfig().isPreventCollision() ? "never" : "");
wrapper.passthrough(Type.BYTE); wrapper.passthrough(Type.BYTE); // Colour
} }
if (mode == 0 || mode == 3 || mode == 4) { if (mode == 0 || mode == 3 || mode == 4) {
String[] players = wrapper.read(Type.STRING_ARRAY); String[] players = wrapper.read(Type.STRING_ARRAY); // Players
final EntityTracker entityTracker = wrapper.user().get(EntityTracker.class); final EntityTracker entityTracker = wrapper.user().get(EntityTracker.class);
String myName = wrapper.user().get(ProtocolInfo.class).getUsername(); String myName = wrapper.user().get(ProtocolInfo.class).getUsername();
for (String player : players) { for (String player : players) {