Code Cleanup pt 3

This commit is contained in:
nossr50
2019-04-03 19:55:52 -07:00
parent 43037f8c13
commit 0ca0140348
44 changed files with 66 additions and 136 deletions

View File

@@ -20,6 +20,7 @@ public class CustomEnumValueSerializer implements TypeSerializer<Enum> {
throw new ObjectMappingException("No value present in node " + value);
}
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt
if (!ret.isPresent()) {
@@ -30,7 +31,7 @@ public class CustomEnumValueSerializer implements TypeSerializer<Enum> {
}
@Override
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) throws ObjectMappingException {
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) {
value.setValue(HOCONUtil.serializeENUMName(obj.name()));
}
}

View File

@@ -20,6 +20,7 @@ public class CustomEnumValueSerializerPartyFeature implements TypeSerializer<Enu
throw new ObjectMappingException("No value present in node " + value);
}
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt
if (!ret.isPresent()) {
@@ -30,7 +31,7 @@ public class CustomEnumValueSerializerPartyFeature implements TypeSerializer<Enu
}
@Override
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) throws ObjectMappingException {
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) {
value.setValue(HOCONUtil.serializeENUMName(obj.name()));
}
}

View File

@@ -58,7 +58,7 @@ public class RepairableSerializer implements TypeSerializer<Repairable> {
}
@Override
public void serialize(TypeToken<?> type, Repairable obj, ConfigurationNode value) throws ObjectMappingException {
public void serialize(TypeToken<?> type, Repairable obj, ConfigurationNode value) {
/*value.getNode("Item").setValue(HOCONUtil.serializeENUMName(obj.getItemMaterial().getKey().getKey()));
value.getNode("Item-Used-To-Repair").setValue(HOCONUtil.serializeENUMName(obj.getRepairMaterials().getKey().getKey()));*/
@@ -71,6 +71,7 @@ public class RepairableSerializer implements TypeSerializer<Repairable> {
private Enum getEnum(String enumConstant, TypeToken<?> type) throws ObjectMappingException
{
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt

View File

@@ -66,7 +66,7 @@ public class ConfigLeveling {
case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap();
case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkills().getSmelting().getLevelCap();
case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().getLevelCap();
default:
@@ -105,7 +105,7 @@ public class ConfigLeveling {
case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled();
case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkills().getSmelting().isLevelCapEnabled();
case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().isLevelCapEnabled();
default: