mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 22:26:46 +01:00
I'll probably end up rewriting these serializers
This commit is contained in:
parent
7385679ec5
commit
90897c9ae1
@ -261,6 +261,8 @@ public final class ConfigManager {
|
||||
customSerializers.registerType(new TypeToken<FormulaType>() {}, new CustomEnumValueSerializer());
|
||||
customSerializers.registerType(new TypeToken<MMOItem<?>>() {}, new ItemStackSerializer());
|
||||
customSerializers.registerType(new TypeToken<Set<?>>() {}, new SetSerializer());
|
||||
|
||||
customSerializers.registerType(new TypeToken<ItemMatch<?>>() {}, new CustomItemTargetSerializer());
|
||||
customSerializers.registerType(new TypeToken<SimpleRepairCost>() {}, new SimpleRepairCostSerializer());
|
||||
|
||||
customSerializers.registerType(TypeToken.of(TamingSummon.class), new TamingSummonSerializer());
|
||||
@ -274,7 +276,6 @@ public final class ConfigManager {
|
||||
customSerializers.registerType(TypeToken.of(PlayerNotificationSettings.class), new PlayerNotificationSerializer());
|
||||
customSerializers.registerType(TypeToken.of(SoundSetting.class), new SoundSettingSerializer());
|
||||
customSerializers.registerType(TypeToken.of(ItemWildcards.class), new ItemWildcardSerializer());
|
||||
customSerializers.registerType(TypeToken.of(ItemMatch.class), new CustomItemTargetSerializer());
|
||||
customSerializers.registerType(TypeToken.of(RepairTransaction.class), new RepairTransactionSerializer());
|
||||
customSerializers.registerType(TypeToken.of(RawNBT.class), new RawNBTSerializer());
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class CustomItemTargetSerializer implements TypeSerializer<ItemMatch> {
|
||||
public class CustomItemTargetSerializer implements TypeSerializer<ItemMatch<?>> {
|
||||
|
||||
private static final String ITEM_CONSUMED_FOR_REPAIR = "Item-Consumed-For-Repair";
|
||||
private static final String ITEM_CONSUMED_FOR_REPAIR = "Target-Item";
|
||||
private static final String NBT_REQUIREMENTS = "NBT-Requirements";
|
||||
|
||||
@Nullable
|
||||
@ -32,7 +32,7 @@ public class CustomItemTargetSerializer implements TypeSerializer<ItemMatch> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(@NonNull TypeToken<?> type, @Nullable ItemMatch obj, @NonNull ConfigurationNode value) throws ObjectMappingException {
|
||||
public void serialize(@NonNull TypeToken<?> type, @Nullable ItemMatch<?> obj, @NonNull ConfigurationNode value) throws ObjectMappingException {
|
||||
value.getNode(ITEM_CONSUMED_FOR_REPAIR).setValue(obj.getItem());
|
||||
|
||||
if(obj.getItemMatchProperties().size() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user