Skip to content

Commit

Permalink
Fix direction and dimension enums
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulloy2 committed May 3, 2020
1 parent 308e3d3 commit bfa0eee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,7 @@ public PotionEffectType getSpecific(Object generic) {
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) {
Expand All @@ -1149,7 +1148,7 @@ public Object getGeneric(Integer specific) {
dimensionFromId = Accessors.getMethodAccessor(reflection.getMethod(contract));
}

return dimensionFromId.invoke(null, (int) specific);
return dimensionFromId.invoke(null, specific);
}

@Override
Expand All @@ -1173,6 +1172,6 @@ public Integer getSpecific(Object generic) {
public Class<Integer> getSpecificType() {
return Integer.class;
}
};
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ private static void initialize() {
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());
Expand Down

0 comments on commit bfa0eee

Please sign in to comment.