Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
remap items in advancements
Dieser Commit ist enthalten in:
Ursprung
2da9b99789
Commit
4c8917c6a0
@ -38,7 +38,48 @@ public class Protocol1_14To1_13_2 extends Protocol {
|
|||||||
registerOutgoing(State.PLAY, 0x4E, 0x4F);
|
registerOutgoing(State.PLAY, 0x4E, 0x4F);
|
||||||
registerOutgoing(State.PLAY, 0x4F, 0x50);
|
registerOutgoing(State.PLAY, 0x4F, 0x50);
|
||||||
registerOutgoing(State.PLAY, 0x50, 0x51);
|
registerOutgoing(State.PLAY, 0x50, 0x51);
|
||||||
registerOutgoing(State.PLAY, 0x51, 0x52);
|
|
||||||
|
registerOutgoing(State.PLAY, 0x51, 0x52, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
handler(new PacketHandler() {
|
||||||
|
@Override
|
||||||
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
|
wrapper.passthrough(Type.BOOLEAN); // Reset/clear
|
||||||
|
int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
wrapper.passthrough(Type.STRING); // Identifier
|
||||||
|
|
||||||
|
// Parent
|
||||||
|
if (wrapper.passthrough(Type.BOOLEAN))
|
||||||
|
wrapper.passthrough(Type.STRING);
|
||||||
|
|
||||||
|
// Display data
|
||||||
|
if (wrapper.passthrough(Type.BOOLEAN)) {
|
||||||
|
wrapper.passthrough(Type.STRING); // Title
|
||||||
|
wrapper.passthrough(Type.STRING); // Description
|
||||||
|
InventoryPackets.toClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Icon
|
||||||
|
wrapper.passthrough(Type.VAR_INT); // Frame type
|
||||||
|
int flags = wrapper.passthrough(Type.INT); // Flags
|
||||||
|
if ((flags & 1) != 0)
|
||||||
|
wrapper.passthrough(Type.STRING); // Background texture
|
||||||
|
wrapper.passthrough(Type.FLOAT); // X
|
||||||
|
wrapper.passthrough(Type.FLOAT); // Y
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.passthrough(Type.STRING_ARRAY); // Criteria
|
||||||
|
|
||||||
|
int arrayLength = wrapper.passthrough(Type.VAR_INT);
|
||||||
|
for (int array = 0; array < arrayLength; array++) {
|
||||||
|
wrapper.passthrough(Type.STRING_ARRAY); // String array
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
registerOutgoing(State.PLAY, 0x52, 0x53);
|
registerOutgoing(State.PLAY, 0x52, 0x53);
|
||||||
registerOutgoing(State.PLAY, 0x53, 0x54);
|
registerOutgoing(State.PLAY, 0x53, 0x54);
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren