mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 20:45:28 +02:00
Code Cleanup pt 3
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user