mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 03:55:28 +01:00
commit
618e09b202
@ -1,4 +1,4 @@
|
|||||||
# ViaVersion 0.4.5
|
# ViaVersion 0.4.6
|
||||||
**Allows the connection of 1.8 clients to 1.9**
|
**Allows the connection of 1.8 clients to 1.9**
|
||||||
|
|
||||||
This plugin modifies netty to allow connection of 1.9 clients to 1.8,
|
This plugin modifies netty to allow connection of 1.9 clients to 1.8,
|
||||||
|
@ -86,6 +86,9 @@ public class MetadataRewriter {
|
|||||||
PacketUtil.writeString((String) value, output);
|
PacketUtil.writeString((String) value, output);
|
||||||
break;
|
break;
|
||||||
case Boolean:
|
case Boolean:
|
||||||
|
if(metaIndex == MetaIndex.AGEABLE_AGE)
|
||||||
|
output.writeBoolean(((Byte) value).byteValue() < 0);
|
||||||
|
else
|
||||||
output.writeBoolean(((Byte) value).byteValue() != 0);
|
output.writeBoolean(((Byte) value).byteValue() != 0);
|
||||||
break;
|
break;
|
||||||
case Slot:
|
case Slot:
|
||||||
|
@ -34,6 +34,7 @@ public class OutgoingTransformer {
|
|||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
private Map<Integer, UUID> uuidMap = new HashMap<Integer, UUID>();
|
private Map<Integer, UUID> uuidMap = new HashMap<Integer, UUID>();
|
||||||
private Map<Integer, EntityType> clientEntityTypes = new HashMap<Integer, EntityType>();
|
private Map<Integer, EntityType> clientEntityTypes = new HashMap<Integer, EntityType>();
|
||||||
|
private Map<Integer, Integer> vehicleMap = new HashMap<>();
|
||||||
|
|
||||||
public OutgoingTransformer(ConnectionInfo info) {
|
public OutgoingTransformer(ConnectionInfo info) {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
@ -82,8 +83,17 @@ public class OutgoingTransformer {
|
|||||||
if (!lead) {
|
if (!lead) {
|
||||||
output.clear();
|
output.clear();
|
||||||
writeVarInt(PacketType.PLAY_SET_PASSENGERS.getNewPacketID(), output);
|
writeVarInt(PacketType.PLAY_SET_PASSENGERS.getNewPacketID(), output);
|
||||||
|
if (vehicle == -1) {
|
||||||
|
if (!vehicleMap.containsKey(passenger))
|
||||||
|
throw new CancelException();
|
||||||
|
vehicle = vehicleMap.remove(passenger);
|
||||||
|
writeVarInt(vehicle,output);
|
||||||
|
writeVarIntArray(Collections.<Integer>emptyList(), output);
|
||||||
|
} else{
|
||||||
writeVarInt(vehicle, output);
|
writeVarInt(vehicle, output);
|
||||||
writeVarIntArray(Collections.singletonList(passenger), output);
|
writeVarIntArray(Collections.singletonList(passenger), output);
|
||||||
|
vehicleMap.put(passenger,vehicle);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
output.writeInt(passenger);
|
output.writeInt(passenger);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: ViaVersion
|
name: ViaVersion
|
||||||
main: us.myles.ViaVersion.ViaVersionPlugin
|
main: us.myles.ViaVersion.ViaVersionPlugin
|
||||||
author: _MylesC
|
author: _MylesC
|
||||||
version: 0.4.5
|
version: 0.4.6
|
||||||
load: startup
|
load: startup
|
||||||
loadbefore: [ProtocolLib, ProxyPipe]
|
loadbefore: [ProtocolLib, ProxyPipe]
|
Loading…
Reference in New Issue
Block a user