mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-29 13:06:00 +01:00
Proper support for all item types in ItemTranslator
This commit is contained in:
parent
15913b98e9
commit
48aef1fd5b
@ -62,14 +62,17 @@ public class ItemTranslator {
|
||||
wrapper.apply(Direction.SERVERBOUND, State.PLAY, 0, protocolPath.stream().map(ProtocolPathEntry::protocol).collect(Collectors.toList()));
|
||||
|
||||
wrapper.read(Type.SHORT);
|
||||
|
||||
if (targetVersion.isOlderThanOrEqualTo(VersionEnum.b1_8tob1_8_1)) {
|
||||
return wrapper.read(Typesb1_8_0_1.CREATIVE_ITEM);
|
||||
} else if (targetVersion.isOlderThan(VersionEnum.r1_13)) {
|
||||
return wrapper.read(Type.ITEM1_8);
|
||||
} else if (targetVersion.isOlderThan(VersionEnum.r1_13_2)) {
|
||||
return wrapper.read(Type.ITEM1_13);
|
||||
} else if (targetVersion.isOlderThanOrEqualTo(VersionEnum.r1_20_2)) {
|
||||
return wrapper.read(Type.ITEM1_13_2);
|
||||
} else {
|
||||
if (wrapper.is(Type.ITEM1_13_2, 0)) {
|
||||
return wrapper.read(Type.ITEM1_13_2);
|
||||
} else {
|
||||
return wrapper.read(Type.ITEM1_8);
|
||||
}
|
||||
return wrapper.read(Type.ITEM1_20_2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ViaFabricPlus.LOGGER.error("Failed to translate item", e);
|
||||
|
Loading…
Reference in New Issue
Block a user