Class MapCodecs
java.lang.Object
net.darkhax.bookshelf.common.api.data.codecs.map.MapCodecs
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.schedule.Activity>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> static final MapCodecHelper<net.minecraft.world.entity.ai.attributes.AttributeModifier> static final MapCodecHelper<net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation> static final MapCodecHelper<net.minecraft.core.Direction.Axis> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.biome.BiomeSource>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.Block>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.entity.BlockEntityType<?>>> static final MapCodecHelper<net.minecraft.core.BlockPos> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.blockpredicates.BlockPredicateType<?>>> static final MapCodecHelper<net.minecraft.world.level.block.state.BlockState> static final com.mojang.serialization.MapCodec<net.minecraft.world.level.block.state.BlockState> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.block.Block>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType<?>>> static final MapCodecHelper<Boolean> static final MapCodecHelper<Byte> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.carver.WorldCarver<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.animal.CatVariant>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.chunk.ChunkGenerator>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.chunk.status.ChunkStatus>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.commands.synchronization.ArgumentTypeInfo<?, ?>>> static final MapCodecHelper<net.minecraft.nbt.CompoundTag> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.CreativeModeTab>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.resources.ResourceLocation>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.component.DataComponentType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.entity.DecoratedPotPattern>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.DensityFunction>>> static final MapCodecHelper<net.minecraft.world.Difficulty> static final MapCodecHelper<net.minecraft.core.Direction> static final MapCodecHelper<Double> static final MapCodecHelper<net.minecraft.world.item.DyeColor> static final MapCodecHelper<net.minecraft.world.effect.MobEffectInstance> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.component.DataComponentType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.LevelBasedValue>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.providers.EnchantmentProvider>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.EntityType<?>>> static final MapCodecHelper<net.minecraft.world.entity.EquipmentSlot> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.Feature<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.featuresize.FeatureSizeType<?>>> static final MapCodecHelper<Float> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.util.valueproviders.FloatProviderType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.animal.FrogVariant>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.gameevent.GameEvent>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.heightproviders.HeightProviderType<?>>> static final MapCodecHelper<net.minecraft.world.item.crafting.Ingredient> static final MapCodecHelper<net.minecraft.world.item.crafting.Ingredient> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.Instrument>> static final MapCodecHelper<Integer> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.util.valueproviders.IntProviderType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.Item>> static final MapCodecHelper<net.minecraft.world.item.Rarity> static final MapCodecHelper<net.minecraft.world.item.ItemStack> static final MapCodecHelper<net.minecraft.world.item.ItemStack> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.advancements.critereon.ItemSubPredicate.Type<?>>> static final MapCodecHelper<ILoadCondition> static final MapCodecHelper<Long> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.predicates.LootItemConditionType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.nbt.LootNbtProviderType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.entries.LootPoolEntryType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.score.LootScoreProviderType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.saveddata.maps.MapDecorationType>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.SurfaceRules.ConditionSource>>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.SurfaceRules.RuleSource>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.memory.MemoryModuleType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.inventory.MenuType<?>>> static final MapCodecHelper<net.minecraft.world.level.block.Mirror> static final MapCodecHelper<net.minecraft.world.entity.MobCategory> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.network.chat.numbers.NumberFormatType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.particles.ParticleType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.placement.PlacementModifierType<?>>> static final MapCodecHelper<net.minecraft.core.Direction.Plane> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBinding>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.PosRuleTestType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.gameevent.PositionSourceType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.crafting.RecipeSerializer<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.crafting.RecipeType<?>>> static final MapCodecHelper<net.minecraft.resources.ResourceLocation> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType<?>>> static final MapCodecHelper<net.minecraft.world.level.block.Rotation> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity.RuleBlockEntityModifierType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.RuleTestType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.schedule.Schedule>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.sensing.SensorType<?>>> static final MapCodecHelper<Short> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> static final MapCodecHelper<net.minecraft.sounds.SoundSource> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.stats.StatType<?>>> static final MapCodecHelper<String> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.placement.StructurePlacementType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pools.StructurePoolElementType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.StructureType<?>>> static final MapCodecHelper<net.minecraft.network.chat.Component> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.advancements.CriterionTrigger<?>>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType<?>>> static final MapCodecHelper<UUID> static final MapCodecHelper<org.joml.Vector3f> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.npc.VillagerProfession>> static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.npc.VillagerType>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<T>>
com.mojang.serialization.Codec<T> enumerable(Class<T> enumClass) Creates a Codec that handles enum values by using their enum constant names.static <T> com.mojang.serialization.MapCodec<T> Creates a Codec that will use a fallback value if no other value is specified.static <T> com.mojang.serialization.MapCodec<T> fallback(com.mojang.serialization.Codec<T> codec, String name, Supplier<T> fallbackSupplier, boolean writesDefault) Creates a Codec that will use a fallback value if no other value is specified.static <T> com.mojang.serialization.Codec<T[]> flexibleArray(com.mojang.serialization.Codec<T> codec, IntFunction<T[]> arrayBuilder) Creates a Codec that can flexibly read both individual values and arrays of values as an array.static <T> com.mojang.serialization.Codec<List<T>> flexibleList(com.mojang.serialization.Codec<T> codec) Creates a Codec that can flexibly read individual values as a list in addition to traditional lists.static <T> com.mojang.serialization.Codec<Set<T>> flexibleSet(com.mojang.serialization.Codec<T> codec) Creates a Codec that can flexibly read both individual values and arrays of values as a set.static <T> com.mojang.serialization.MapCodec<T> Creates a Codec that can handle nullable values.static <T> com.mojang.serialization.MapCodec<Optional<T>> optional(com.mojang.serialization.Codec<T> codec, String name, Optional<T> fallback, boolean writesDefault) Creates a Codec that handles optional values.static <T> com.mojang.serialization.Codec<T> xor(com.mojang.serialization.Codec<T> first, com.mojang.serialization.Codec<T> second) Creates a codec that will try two different codecs, using the first valid codec.
-
Field Details
-
BOOLEAN
-
BYTE
-
SHORT
-
INT
-
FLOAT
-
LONG
-
DOUBLE
-
STRING
-
UUID
-
GAME_EVENT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.gameevent.GameEvent>> GAME_EVENT -
SOUND_EVENT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> SOUND_EVENT -
FLUID
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid>> FLUID -
MOB_EFFECT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect>> MOB_EFFECT -
BLOCK
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.Block>> BLOCK -
ENTITY_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.EntityType<?>>> ENTITY_TYPE -
ITEM
-
POTION
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> POTION -
PARTICLE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.particles.ParticleType<?>>> PARTICLE_TYPE -
BLOCK_ENTITY_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.entity.BlockEntityType<?>>> BLOCK_ENTITY_TYPE -
CUSTOM_STAT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.resources.ResourceLocation>> CUSTOM_STAT -
CHUNK_STATUS
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.chunk.status.ChunkStatus>> CHUNK_STATUS -
RULE_TEST
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.RuleTestType<?>>> RULE_TEST -
RULE_BLOCK_ENTITY_MODIFIER
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity.RuleBlockEntityModifierType<?>>> RULE_BLOCK_ENTITY_MODIFIER -
POS_RULE_TEST
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.PosRuleTestType<?>>> POS_RULE_TEST -
MENU
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.inventory.MenuType<?>>> MENU -
RECIPE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.crafting.RecipeType<?>>> RECIPE_TYPE -
RECIPE_SERIALIZER
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.crafting.RecipeSerializer<?>>> RECIPE_SERIALIZER -
ATTRIBUTE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> ATTRIBUTE -
POSITION_SOURCE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.gameevent.PositionSourceType<?>>> POSITION_SOURCE_TYPE -
COMMAND_ARGUMENT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.commands.synchronization.ArgumentTypeInfo<?,?>>> COMMAND_ARGUMENT_TYPE -
STAT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.stats.StatType<?>>> STAT_TYPE -
VILLAGER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.npc.VillagerType>> VILLAGER_TYPE -
VILLAGER_PROFESSION
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.npc.VillagerProfession>> VILLAGER_PROFESSION -
POINT_OF_INTEREST_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> POINT_OF_INTEREST_TYPE -
MEMORY_MODULE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.memory.MemoryModuleType<?>>> MEMORY_MODULE_TYPE -
SENSOR_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.ai.sensing.SensorType<?>>> SENSOR_TYPE -
SCHEDULE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.schedule.Schedule>> SCHEDULE -
ACTIVITY
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.schedule.Activity>> ACTIVITY -
LOOT_POOL_ENTRY_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.entries.LootPoolEntryType>> LOOT_POOL_ENTRY_TYPE -
LOOT_FUNCTION_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<?>>> LOOT_FUNCTION_TYPE -
LOOT_CONDITION_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.predicates.LootItemConditionType>> LOOT_CONDITION_TYPE -
LOOT_NUMBER_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType>> LOOT_NUMBER_PROVIDER_TYPE -
LOOT_NBT_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.nbt.LootNbtProviderType>> LOOT_NBT_PROVIDER_TYPE -
LOOT_SCORE_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.storage.loot.providers.score.LootScoreProviderType>> LOOT_SCORE_PROVIDER_TYPE -
FLOAT_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.util.valueproviders.FloatProviderType<?>>> FLOAT_PROVIDER_TYPE -
INT_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.util.valueproviders.IntProviderType<?>>> INT_PROVIDER_TYPE -
HEIGHT_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.heightproviders.HeightProviderType<?>>> HEIGHT_PROVIDER_TYPE -
BLOCK_PREDICATE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.blockpredicates.BlockPredicateType<?>>> BLOCK_PREDICATE_TYPE -
CARVER
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.carver.WorldCarver<?>>> CARVER -
FEATURE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.Feature<?>>> FEATURE -
STRUCTURE_PLACEMENT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.placement.StructurePlacementType<?>>> STRUCTURE_PLACEMENT -
STRUCTURE_PIECE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType>> STRUCTURE_PIECE -
STRUCTURE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.StructureType<?>>> STRUCTURE_TYPE -
PLACEMENT_MODIFIER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.placement.PlacementModifierType<?>>> PLACEMENT_MODIFIER_TYPE -
BLOCKSTATE_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType<?>>> BLOCKSTATE_PROVIDER_TYPE -
FOLIAGE_PLACER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType<?>>> FOLIAGE_PLACER_TYPE -
TRUNK_PLACER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType<?>>> TRUNK_PLACER_TYPE -
ROOT_PLACER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType<?>>> ROOT_PLACER_TYPE -
TREE_DECORATOR_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType<?>>> TREE_DECORATOR_TYPE -
FEATURE_SIZE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.feature.featuresize.FeatureSizeType<?>>> FEATURE_SIZE_TYPE -
BIOME_SOURCE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.biome.BiomeSource>>> BIOME_SOURCE -
CHUNK_GENERATOR
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.chunk.ChunkGenerator>>> CHUNK_GENERATOR -
MATERIAL_CONDITION
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.SurfaceRules.ConditionSource>>> MATERIAL_CONDITION -
MATERIAL_RULE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.SurfaceRules.RuleSource>>> MATERIAL_RULE -
DENSITY_FUNCTION_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.DensityFunction>>> DENSITY_FUNCTION_TYPE -
BLOCK_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.block.Block>>> BLOCK_TYPE -
STRUCTURE_PROCESSOR
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType<?>>> STRUCTURE_PROCESSOR -
STRUCTURE_POOL_ELEMENT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pools.StructurePoolElementType<?>>> STRUCTURE_POOL_ELEMENT -
POOL_ALIAS_BINDING_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBinding>>> POOL_ALIAS_BINDING_TYPE -
CAT_VARIANT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.animal.CatVariant>> CAT_VARIANT -
FROG_VARIANT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.entity.animal.FrogVariant>> FROG_VARIANT -
INSTRUMENT
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.Instrument>> INSTRUMENT -
DECORATED_POT_PATTERN
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.block.entity.DecoratedPotPattern>> DECORATED_POT_PATTERN -
CREATIVE_MODE_TAB
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.CreativeModeTab>> CREATIVE_MODE_TAB -
TRIGGER_TYPES
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.advancements.CriterionTrigger<?>>> TRIGGER_TYPES -
NUMBER_FORMAT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.network.chat.numbers.NumberFormatType<?>>> NUMBER_FORMAT_TYPE -
ARMOR_MATERIAL
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial>> ARMOR_MATERIAL -
DATA_COMPONENT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.component.DataComponentType<?>>> DATA_COMPONENT_TYPE -
ENTITY_SUB_PREDICATE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>>> ENTITY_SUB_PREDICATE_TYPE -
ITEM_SUB_PREDICATE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.advancements.critereon.ItemSubPredicate.Type<?>>> ITEM_SUB_PREDICATE_TYPE -
MAP_DECORATION_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.world.level.saveddata.maps.MapDecorationType>> MAP_DECORATION_TYPE -
ENCHANTMENT_EFFECT_COMPONENT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<net.minecraft.core.component.DataComponentType<?>>> ENCHANTMENT_EFFECT_COMPONENT_TYPE -
ENCHANTMENT_LEVEL_BASED_VALUE_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.LevelBasedValue>>> ENCHANTMENT_LEVEL_BASED_VALUE_TYPE -
ENCHANTMENT_ENTITY_EFFECT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect>>> ENCHANTMENT_ENTITY_EFFECT_TYPE -
ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect>>> ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE -
ENCHANTMENT_VALUE_EFFECT_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect>>> ENCHANTMENT_VALUE_EFFECT_TYPE -
ENCHANTMENT_PROVIDER_TYPE
public static final MapCodecHelper<net.minecraft.core.Holder<com.mojang.serialization.MapCodec<? extends net.minecraft.world.item.enchantment.providers.EnchantmentProvider>>> ENCHANTMENT_PROVIDER_TYPE -
ITEM_RARITY
-
ATTRIBUTE_OPERATION
public static final MapCodecHelper<net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation> ATTRIBUTE_OPERATION -
DIRECTION
-
AXIS
-
PLANE
-
MOB_CATEGORY
-
DYE_COLOR
-
SOUND_SOURCE
-
DIFFICULTY
-
EQUIPMENT_SLOT
-
MIRROR
-
ROTATION
-
RESOURCE_LOCATION
-
COMPOUND_TAG
-
ITEM_STACK
-
ITEM_STACK_STRICT
-
TEXT
-
BLOCK_POS
-
INGREDIENT
-
INGREDIENT_NONEMPTY
public static final MapCodecHelper<net.minecraft.world.item.crafting.Ingredient> INGREDIENT_NONEMPTY -
BLOCK_STATE_MAP_CODEC
public static final com.mojang.serialization.MapCodec<net.minecraft.world.level.block.state.BlockState> BLOCK_STATE_MAP_CODEC -
BLOCK_STATE
-
ATTRIBUTE_MODIFIER
public static final MapCodecHelper<net.minecraft.world.entity.ai.attributes.AttributeModifier> ATTRIBUTE_MODIFIER -
EFFECT_INSTANCE
-
VECTOR_3F
-
LOAD_CONDITION
-
-
Constructor Details
-
MapCodecs
public MapCodecs()
-
-
Method Details
-
flexibleList
public static <T> com.mojang.serialization.Codec<List<T>> flexibleList(com.mojang.serialization.Codec<T> codec) Creates a Codec that can flexibly read individual values as a list in addition to traditional lists.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The codec for reading an individual value.- Returns:
- A Codec that can flexibly read individual values as a list in addition to traditional lists.
-
flexibleSet
public static <T> com.mojang.serialization.Codec<Set<T>> flexibleSet(com.mojang.serialization.Codec<T> codec) Creates a Codec that can flexibly read both individual values and arrays of values as a set.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The Codec for reading an individual value.- Returns:
- A Codec that can flexibly read both individual values and arrays of values as a set.
-
flexibleArray
public static <T> com.mojang.serialization.Codec<T[]> flexibleArray(com.mojang.serialization.Codec<T> codec, IntFunction<T[]> arrayBuilder) Creates a Codec that can flexibly read both individual values and arrays of values as an array.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The Codec for reading an individual value.arrayBuilder- A function that creates new arrays of the required type. The function is given the size of the list.- Returns:
- A Codec that can flexibly read both individual values and arrays of values as an array.
-
fallback
public static <T> com.mojang.serialization.MapCodec<T> fallback(com.mojang.serialization.Codec<T> codec, String name, Supplier<T> fallbackSupplier) Creates a Codec that will use a fallback value if no other value is specified. This is different fromCodec.optionalFieldOf(String, Object)in that the fallback value is provided by a supplier.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The base Codec to use.name- The name of the field to read from.fallbackSupplier- A supplier that produces the default value. You should probably memoize this.- Returns:
- A Codec that will use a fallback value if the field is not specified.
-
optional
public static <T> com.mojang.serialization.MapCodec<Optional<T>> optional(com.mojang.serialization.Codec<T> codec, String name, Optional<T> fallback, boolean writesDefault) Creates a Codec that handles optional values. This is different fromCodec.optionalFieldOf(String, Object)in that it keeps the type as an Optional.- Type Parameters:
T- The type of the optional value handled by the coded.- Parameters:
codec- The base Codec to use.name- The name of the field to read from.fallback- The fallback optional value.writesDefault- Should the default value be written or left blank?- Returns:
- A Codec that handles optional values.
-
nullable
public static <T> com.mojang.serialization.MapCodec<T> nullable(com.mojang.serialization.Codec<T> codec, String fieldName) Creates a Codec that can handle nullable values.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The base Codec to use.fieldName- The name of the field to read from.- Returns:
- A Codec that handles nullable values.
-
fallback
public static <T> com.mojang.serialization.MapCodec<T> fallback(com.mojang.serialization.Codec<T> codec, String name, Supplier<T> fallbackSupplier, boolean writesDefault) Creates a Codec that will use a fallback value if no other value is specified. This is different fromCodec.optionalFieldOf(String, Object)in that the fallback value is provided by a supplier. It also allows you to control if the default value should be written when or left blank.- Type Parameters:
T- The type of value handled by the codec.- Parameters:
codec- The base Codec to use.name- The name of the field to read from.fallbackSupplier- A supplier that produces the default value. You should probably memoize this.writesDefault- Should the default value be written or left blank?- Returns:
- A Codec that will use a fallback value if the field is not specified.
-
enumerable
Creates a Codec that handles enum values by using their enum constant names.
If the codec can not read an enum value from the provided name it will try again using an all uppercase version of the input. This allows users to write values in all lowercase which may feel more natural for some users and adds extra flexibility.
If the codec can not read any enum value from the provided name it will create an error. The error message will try to help the user by recommending a nearby match and including all possible values.- Type Parameters:
T- The type of the enum.- Parameters:
enumClass- The class of the enum to get values for.- Returns:
- A codec that can read and write enum values using their enum constant name.
-
xor
public static <T> com.mojang.serialization.Codec<T> xor(com.mojang.serialization.Codec<T> first, com.mojang.serialization.Codec<T> second) Creates a codec that will try two different codecs, using the first valid codec. Encoding will always use the first codec.- Type Parameters:
T- The type of codec to create.- Parameters:
first- The first codec to try when decoding. This will be the only codec used in encoding.second- The second codec to try when decoding.- Returns:
- A codec that will try two different codecs.
-