3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00

Update to 0.5.3, add inventory title tracking so we're working towards some of the inventory bugs with new ones.

Dieser Commit ist enthalten in:
Myles 2016-03-06 00:25:24 +00:00
Ursprung 0d0e1c16ea
Commit e487eeb395
6 geänderte Dateien mit 28 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
# ViaVersion 0.5.2
# ViaVersion 0.5.3
**Allows the connection of 1.9 clients to 1.8**
This plugin modifies netty to allow connection of 1.9 clients to 1.8,

Datei anzeigen

@ -5,7 +5,7 @@
<groupId>us.myles</groupId>
<artifactId>ViaVersion</artifactId>
<version>0.5.2</version>
<version>0.5.3</version>
<build>
<finalName>ViaVersion-${project.version}</finalName>
<plugins>

Datei anzeigen

@ -14,6 +14,7 @@ public class ConnectionInfo {
private Object lastPacket;
private java.util.UUID UUID;
private State state = State.HANDSHAKE;
private String openWindow;
private int protocol = 0;
private int compression = 0;
private boolean active = true;
@ -87,4 +88,16 @@ public class ConnectionInfo {
}
});
}
public String getOpenWindow() {
return openWindow;
}
public void setOpenWindow(String openWindow) {
this.openWindow = openWindow;
}
public void closeWindow() {
this.openWindow = null;
}
}

Datei anzeigen

@ -136,6 +136,9 @@ public class IncomingTransformer {
ItemSlotRewriter.rewrite1_9To1_8(input, output);
return;
}
if (packet == PacketType.PLAY_CLOSE_WINDOW_REQUEST) {
info.closeWindow();
}
if (packet == PacketType.PLAY_CLIENT_SETTINGS) {
String locale = PacketUtil.readString(input);
PacketUtil.writeString(locale, output);

Datei anzeigen

@ -411,14 +411,23 @@ public class OutgoingTransformer {
if (packet == PacketType.PLAY_OPEN_WINDOW) {
int windowId = input.readUnsignedByte();
String type = readString(input);
info.setOpenWindow(type);
String windowTitle = readString(input);
output.writeByte(windowId);
writeString(type, output);
writeString(fixJson(windowTitle), output);
int slots = input.readUnsignedByte();
if(type.equals("minecraft:brewing_stand")){
slots = slots + 1; // new slot
}
output.writeByte(slots);
output.writeBytes(input);
return;
}
if (packet == PacketType.PLAY_CLOSE_WINDOW) {
info.closeWindow();
}
if (packet == PacketType.PLAY_SET_SLOT) {
int windowId = input.readUnsignedByte();
output.writeByte(windowId);