Interface DataSerializable
-
- All Known Subinterfaces:
Advancement,Aerial,Ageable,Agent,Ambient,Animal,AnvilCost,Aquatic,Archetype<S,E>,AreaEffectCloud,ArmorStand,Arrow,ArrowEntity,Banner,BannerPatternLayer,Barrel,Bat,Beacon,Bed,Bee,Beehive,Bell,BlastFurnace,Blaze,BlockEntity,BlockEntityArchetype,BlockOccupiedMinecart,BlockSnapshot,BlockState,Boat,Boss,BrewingStand,Campfire,CarrierBlockEntity,CarrierMinecart<M>,Cat,CaveSpider,Chest,ChestMinecart,Chicken,ClientPlayer,Cod,CommandBlock,CommandBlockMinecart,Comparator,ComplexLiving<T>,ComplexLivingPart<P>,Conduit,Cow,Creature,Creeper,DamagingProjectile,DataPackSerializable,DaylightDetector,Dispenser,Dolphin,Donkey,DragonFireball,Dropper,Drowned,Egg,ElderGuardian,Enchantment,EnchantmentTable,EndCrystal,EnderChest,EnderDragon,EnderDragonPart,Enderman,Endermite,EnderPearl,EndGateway,EndPortal,Entity,EntityArchetype,EntitySnapshot,EntityTargetingProjectile,Evoker,EvokerFangs,ExperienceBottle,ExperienceOrb,Explosive,ExplosiveFireball,EyeOfEnder,FallingBlock,FireballEntity,FireworkEffect,FireworkRocket,Fish,FishingBobber,FluidStack,FluidStackSnapshot,FluidState,Fox,Furnace,FurnaceBlockEntity,FurnaceMinecart,FusedExplosive,GameProfile,Ghast,Giant,Golem,Guardian,Hanging,Hoglin,Hopper,HopperMinecart,Horse,HorseLike,Hostile,Human,Humanoid,Husk,Illager,Illusioner,IronGolem,Item,ItemFrame,ItemStack,ItemStackSnapshot,Jigsaw,Jukebox,KeyValueMatcher<V>,LeashKnot,Lectern,LightningBolt,Living,Llama,LlamaLike,LlamaSpit,LocalPlayer,LocatableBlock,LocatableSnapshot<T>,MagmaCube,MapCanvas,MapColor,MapDecoration,MapInfo,Minecart,MinecartLike,MobSpawner,Monster,Mooshroom,Mule,NameableBlockEntity,NameableCarrierBlockEntity,Ocelot,PackHorse,Painting,Panda,Parrot,ParticleEffect,Patroller,Phantom,Pig,Piglin,PiglinBrute,PiglinLike,Pillager,Piston,Player,PolarBear,Potion,PotionEffect,PrimedTNT,ProfileProperty,Projectile,Pufferfish,Rabbit,Raider,Ranger,Ravager,RecipeRegistration,RemotePlayer,Salmon,SchoolingFish,SerializableDataHolder,SerializableDataHolder.Immutable<I>,SerializableDataHolder.Mutable,ServerLocation,ServerPlayer,Sheep,Shulker,ShulkerBox,ShulkerBullet,Sign,Silverfish,Sittable,Skeleton,SkeletonHorse,SkeletonLike,Skull,Slime,SmallFireball,Smoker,Snowball,SnowGolem,Spawner,SpawnerMinecart,SpectralArrow,Spellcaster,Spider,Squid,State<S>,Stray,Strider,StructureBlock,TagTemplate,TameableAnimal,TameableHorse,TNTMinecart,TradeOffer,Trader,TraderLlama,TrappedChest,Trident,TropicalFish,Turtle,VariableAmount,Vehicle,Vex,Villager,Vindicator,WanderingTrader,Weather,WeatherEffect,Witch,Wither,WitherSkeleton,WitherSkull,Wolf,WorldTemplate,WorldTypeTemplate,Zoglin,Zombie,ZombieHorse,ZombieLike,ZombieVillager,ZombifiedPiglin
- All Known Implementing Classes:
BlockTransaction,BlockTransactionReceipt,Color,EmptyObject,RespawnLocation,SlotTransaction,Transaction,VariableAmount.BaseAndAddition,VariableAmount.BaseAndVariance,VariableAmount.Fixed,VariableAmount.OptionalAmount,WeightedSerializableObject
public interface DataSerializableRepresents an object that can be represented by aDataContainer.DataContainers received from
toContainer()should be considered to be copies of the original data, and therefore, thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcontentVersion()Gets the content version of thisDataSerializable.DataContainertoContainer()Serializes this object into a comprehensibleDataContainer.
-
-
-
Method Detail
-
contentVersion
int contentVersion()
Gets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromtoContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Returns:
- The version of the content being serialized
-
toContainer
DataContainer toContainer()
Serializes this object into a comprehensibleDataContainer.- Returns:
- A newly created DataContainer
-
-