Interface DataSerializable
- All Known Subinterfaces:
AcceleratingProjectile,Aerial,Ageable,Agent,Allay,Ambient,Angerable,Animal,AnvilCost,Aquatic,Archetype<S,,E> AreaEffectCloud,Armadillo,ArmorStand,Arrow,ArrowLike,Attackable,Axolotl,Banner,BannerPatternLayer,Barrel,Bat,Beacon,Bed,Bee,Beehive,Bell,BlastFurnace,Blaze,BlockDisplay,BlockEntity,BlockEntityArchetype,BlockOccupiedMinecart,BlockSnapshot,BlockState,Boat,Bogged,Boss,Breedable,Breeze,BreezeWindCharge,BrewingStand,Camel,CamelHusk,Campfire,CarrierBlockEntity,CarrierMinecart<M>,Cat,CaveSpider,Chargeable,Chest,ChestBoat,ChestMinecart,Chicken,ClientPlayer,Cod,CommandBlock,CommandBlockMinecart,Comparator,ComplexLiving<T>,ComplexLivingPart<P>,Conduit,CopperGolem,Cow,Crafter,Creaking,CreakingHeart,Creeper,DaylightDetector,DecoratedPot,Dispenser,DisplayEntity,Dolphin,Donkey,DragonFireball,Dropper,Drowned,Egg,ElderGuardian,Enchantment,EnchantmentTable,EndCrystal,EnderChest,EnderDragon,EnderDragonPart,Enderman,Endermite,EnderPearl,EndGateway,EndPortal,Entity,EntityArchetype,EntitySnapshot,Evoker,EvokerFangs,ExperienceBottle,ExperienceOrb,Explosive,ExplosiveFireball,EyeOfEnder,FallingBlock,FireworkEffect,FireworkRocket,Fish,FishingBobber,FluidStack,FluidStackSnapshot,FluidState,Fox,Frog,Furnace,FurnaceBlockEntity,FurnaceMinecart,FusedExplosive,GameProfile,Ghast,Giant,GlowItemFrame,GlowSquid,Goat,Golem,Guardian,Hanging,HappyGhast,Hoglin,Hopper,HopperMinecart,Horse,HorseLike,Hostile,Human,Humanoid,Husk,IgnitingProjectile,Illager,Illusioner,Interaction,IronGolem,Item,ItemDisplay,ItemFrame,ItemRepresentable,ItemStack,ItemStackLike,ItemStackSnapshot,Jigsaw,Jukebox,KeyValueMatcher<V>,Leashable,LeashKnot,Lectern,LightningBolt,Living,Llama,LlamaSpit,LocalPlayer,LocatableBlock,LocatableSnapshot<T>,MagmaCube,Mannequin,MapCanvas,MapColor,MapDecoration,MapInfo,Marker,Minecart,MinecartLike,MobSpawner,Monster,Mooshroom,Mule,NameableBlockEntity,NameableCarrierBlockEntity,Nautilus,NautilusLike,Ocelot,OfflineChunk,OminousItemSpawner,Ownable,PackHorse,Painting,Panda,Parched,Parrot,ParticleEffect,PathfinderAgent,Patroller,Phantom,Pig,Piglin,PiglinBrute,PiglinLike,Pillager,Piston,Player,PolarBear,Potion,PotionEffect,PrimedTNT,ProfileProperty,Projectile,Pufferfish,Rabbit,Raft,Raider,RangedAgent,Ranger,Ravager,RemotePlayer,Saddleable,Salmon,SchoolingFish,SculkSensor,SerializableDataHolder,SerializableDataHolder.Immutable<I>,SerializableDataHolder.Mutable,ServerLocation,ServerPlayer,Sheep,Shulker,ShulkerBox,ShulkerBullet,Sign,Silverfish,Sittable,Skeleton,SkeletonHorse,SkeletonLike,Skull,Slime,SmallFireball,Smoker,Sniffer,Snowball,SnowGolem,Spawner,SpawnerMinecart,SpectralArrow,Spellcaster,Spider,Squid,State<S>,Stray,Strider,StructureBlock,Tadpole,TameableAnimal,Targeting,TextDisplay,ThrowableItemProjectile,TNTMinecart,TradeOffer,TraderLlama,TrappedChest,TrialSpawner,Trident,TropicalFish,Turtle,VariableAmount,Vehicle,Vex,Villager,VillagerLike,Vindicator,WanderingTrader,Warden,Weather,WindCharge,WindChargeLike,Witch,Wither,WitherSkeleton,WitherSkull,Wolf,Zoglin,Zombie,ZombieHorse,ZombieNautilus,ZombieVillager,ZombifiedPiglin
- All Known Implementing Classes:
BlockTransaction,BlockTransactionReceipt,Color,EmptyObject,RespawnLocation,SlotTransaction,Transaction,VariableAmount.BaseAndAddition,VariableAmount.BaseAndVariance,VariableAmount.Fixed,VariableAmount.OptionalAmount,WeightedSerializableObject
public interface DataSerializable
Represents an object that can be represented by a
DataContainer.
DataContainers received from toContainer()
should be considered to be copies of the original data, and therefore,
thread safe.
-
Method Summary
Modifier and TypeMethodDescriptionintGets the content version of thisDataSerializable.Serializes this object into a comprehensibleDataContainer.default DataViewSerializes this object and applies the provided data to the providedDataViewinstead of creating a newDataContainer, reducing nested information.
-
Method Details
-
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
-
toView
Serializes this object and applies the provided data to the providedDataViewinstead of creating a newDataContainer, reducing nested information.- Parameters:
container- The data view to serialize to- Returns:
- The provided data view, for chaining
-