mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-08 09:27:34 +01:00
Fix direction and dimension enums
This commit is contained in:
parent
308e3d3417
commit
bfa0eee91e
@ -1133,8 +1133,7 @@ public class BukkitConverters {
|
||||
private static MethodAccessor idFromDimension = null;
|
||||
|
||||
public static EquivalentConverter<Integer> getDimensionIDConverter() {
|
||||
return new EquivalentConverter<Integer>() {
|
||||
|
||||
return ignoreNull(new EquivalentConverter<Integer>() {
|
||||
@Override
|
||||
public Object getGeneric(Integer specific) {
|
||||
if (dimensionFromId == null) {
|
||||
@ -1149,7 +1148,7 @@ public class BukkitConverters {
|
||||
dimensionFromId = Accessors.getMethodAccessor(reflection.getMethod(contract));
|
||||
}
|
||||
|
||||
return dimensionFromId.invoke(null, (int) specific);
|
||||
return dimensionFromId.invoke(null, specific);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1173,6 +1172,6 @@ public class BukkitConverters {
|
||||
public Class<Integer> getSpecificType() {
|
||||
return Integer.class;
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ public abstract class EnumWrappers {
|
||||
SOUND_CATEGORY_CLASS = getEnum(PacketType.Play.Server.CUSTOM_SOUND_EFFECT.getPacketClass(), 0);
|
||||
ITEM_SLOT_CLASS = getEnum(PacketType.Play.Server.ENTITY_EQUIPMENT.getPacketClass(), 0);
|
||||
HAND_CLASS = getEnum(PacketType.Play.Client.USE_ENTITY.getPacketClass(), 1);
|
||||
DIRECTION_CLASS = getEnum(PacketType.Play.Client.USE_ITEM.getPacketClass(), 0);
|
||||
DIRECTION_CLASS = getEnum(PacketType.Play.Server.SPAWN_ENTITY_PAINTING.getPacketClass(), 0);
|
||||
CHAT_TYPE_CLASS = getEnum(PacketType.Play.Server.CHAT.getPacketClass(), 0);
|
||||
|
||||
associate(PROTOCOL_CLASS, Protocol.class, getClientCommandConverter());
|
||||
|
Loading…
Reference in New Issue
Block a user