Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Fixed riding on entities.
Dieser Commit ist enthalten in:
Ursprung
7831dc0082
Commit
6f25090c01
@ -184,6 +184,13 @@ public class PacketUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeVarIntArray(List<Integer> integers, ByteBuf output) {
|
||||
writeVarInt(integers.size(),output);
|
||||
for (Integer i : integers){
|
||||
writeVarInt(i,output);
|
||||
}
|
||||
}
|
||||
|
||||
public static int readVarShort(ByteBuf buf) {
|
||||
int low = buf.readUnsignedShort();
|
||||
int high = 0;
|
||||
|
@ -36,7 +36,7 @@ public class IncomingTransformer {
|
||||
// if (packet != PacketType.PLAY_PLAYER_POSITION_LOOK_REQUEST && packet != PacketType.PLAY_KEEP_ALIVE_REQUEST && packet != PacketType.PLAY_PLAYER_POSITION_REQUEST && packet != PacketType.PLAY_PLAYER_LOOK_REQUEST) {
|
||||
// System.out.println("Packet Type: " + packet + " New ID: " + packetID + " Original: " + original);
|
||||
// }
|
||||
if (packet == PacketType.PLAY_TP_CONFIRM) {
|
||||
if (packet == PacketType.PLAY_TP_CONFIRM || packet == PacketType.PLAY_VEHICLE_MOVE_REQUEST) { //TODO handle client-sided horse riding
|
||||
throw new CancelException();
|
||||
}
|
||||
PacketUtil.writeVarInt(packetID, output);
|
||||
|
@ -25,8 +25,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
import static us.myles.ViaVersion.PacketUtil.readString;
|
||||
import static us.myles.ViaVersion.PacketUtil.writeString;
|
||||
import static us.myles.ViaVersion.PacketUtil.*;
|
||||
|
||||
public class OutgoingTransformer {
|
||||
private static Gson gson = new Gson();
|
||||
@ -75,10 +74,18 @@ public class OutgoingTransformer {
|
||||
output.writeBytes(input);
|
||||
}
|
||||
if (packet == PacketType.PLAY_ATTACH_ENTITY) {
|
||||
int id = input.readInt();
|
||||
output.writeInt(id);
|
||||
int target = input.readInt();
|
||||
output.writeInt(target);
|
||||
int passenger = input.readInt();
|
||||
int vehicle = input.readInt();
|
||||
boolean lead = input.readBoolean();
|
||||
if (!lead){
|
||||
output.clear();
|
||||
writeVarInt(PacketType.PLAY_SET_PASSENGERS.getNewPacketID(),output);
|
||||
writeVarInt(vehicle,output);
|
||||
writeVarIntArray(Collections.singletonList(passenger),output);
|
||||
return;
|
||||
}
|
||||
output.writeInt(passenger);
|
||||
output.writeInt(vehicle);
|
||||
return;
|
||||
}
|
||||
if (packet == PacketType.PLAY_DISCONNECT){
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren