Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-09 17:50:23 +01:00
Merge branch 'master' into master
Dieser Commit ist enthalten in:
Commit
8476c83d62
@ -3,8 +3,6 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2;
|
|||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
|
||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
@ -462,40 +460,35 @@ public class Protocol1_13To1_12_2 extends Protocol {
|
|||||||
handler(new PacketHandler() {
|
handler(new PacketHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
int mappingSize = wrapper.passthrough(Type.VAR_INT);
|
wrapper.passthrough(Type.BOOLEAN); // Reset/clear
|
||||||
for (int i = 0; i < mappingSize; i++) {
|
int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
wrapper.passthrough(Type.STRING); // Identifier
|
wrapper.passthrough(Type.STRING); // Identifier
|
||||||
// Advancement start
|
|
||||||
boolean hasParent = wrapper.passthrough(Type.BOOLEAN);
|
// Parent
|
||||||
if (hasParent) wrapper.passthrough(Type.STRING); // Parent id
|
if (wrapper.passthrough(Type.BOOLEAN))
|
||||||
boolean hasDisplay = wrapper.passthrough(Type.BOOLEAN);
|
wrapper.passthrough(Type.STRING);
|
||||||
if (hasDisplay) {
|
|
||||||
// Display start
|
// Display data
|
||||||
wrapper.passthrough(Type.STRING); // Title - Chat
|
if (wrapper.passthrough(Type.BOOLEAN)) {
|
||||||
wrapper.passthrough(Type.STRING); // Description - Chat
|
wrapper.passthrough(Type.STRING); // Title
|
||||||
Item icon = wrapper.read(Type.ITEM);
|
wrapper.passthrough(Type.STRING); // Description
|
||||||
wrapper.write(Type.FLAT_ITEM, icon);
|
wrapper.write(Type.FLAT_ITEM, wrapper.read(Type.ITEM)); // Translate item to flat item
|
||||||
InventoryPackets.toClient(icon);
|
|
||||||
wrapper.passthrough(Type.VAR_INT); // Frame type
|
wrapper.passthrough(Type.VAR_INT); // Frame type
|
||||||
int flags = wrapper.passthrough(Type.INT); // Flags
|
int flags = wrapper.passthrough(Type.INT); // Flags
|
||||||
if ((flags & 1) != 0) wrapper.passthrough(Type.STRING); // Background texture
|
if ((flags & 1) != 0)
|
||||||
wrapper.passthrough(Type.FLOAT); // X coord
|
wrapper.passthrough(Type.STRING); // Background texture
|
||||||
wrapper.passthrough(Type.FLOAT); // Y coord
|
wrapper.passthrough(Type.FLOAT); // X
|
||||||
// Display end
|
wrapper.passthrough(Type.FLOAT); // Y
|
||||||
}
|
}
|
||||||
int numberOfCriteria = wrapper.passthrough(Type.VAR_INT); // Number of criteria
|
|
||||||
for (int x = 0; x < numberOfCriteria; x++) {
|
wrapper.passthrough(Type.STRING_ARRAY); // Criteria
|
||||||
wrapper.passthrough(Type.STRING); // Criteria identifier
|
|
||||||
wrapper.passthrough(Type.NOTHING); // nothing
|
int arrayLength = wrapper.passthrough(Type.VAR_INT);
|
||||||
|
for (int array = 0; array < arrayLength; array++) {
|
||||||
|
wrapper.passthrough(Type.STRING_ARRAY); // String array
|
||||||
}
|
}
|
||||||
int numberOfRequirements = wrapper.passthrough(Type.VAR_INT);
|
|
||||||
for (int x = 0; x < numberOfRequirements; x++) {
|
|
||||||
int criteriasLength = wrapper.passthrough(Type.VAR_INT);
|
|
||||||
for (int z = 0; z < criteriasLength; z++) {
|
|
||||||
wrapper.passthrough(Type.STRING);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Advancement end
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren