Package org.spongepowered.api.data
Interface SerializableDataHolder.Mutable
-
- All Superinterfaces:
CopyableDataHolder
,DataHolder
,DataHolder.Mutable
,DataSerializable
,SerializableDataHolder
,ValueContainer
- All Known Subinterfaces:
Aerial
,Ageable
,Agent
,Ambient
,Animal
,Aquatic
,Archetype<S,E>
,AreaEffectCloud
,ArmorStand
,Arrow
,ArrowEntity
,Banner
,Barrel
,Bat
,Beacon
,Bed
,Bee
,Beehive
,Bell
,BlastFurnace
,Blaze
,BlockEntity
,BlockEntityArchetype
,BlockOccupiedMinecart
,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
,DaylightDetector
,Dispenser
,Dolphin
,Donkey
,DragonFireball
,Dropper
,Drowned
,Egg
,ElderGuardian
,EnchantmentTable
,EndCrystal
,EnderChest
,EnderDragon
,EnderDragonPart
,Enderman
,Endermite
,EnderPearl
,EndGateway
,EndPortal
,Entity
,EntityArchetype
,EntityTargetingProjectile
,Evoker
,EvokerFangs
,ExperienceBottle
,ExperienceOrb
,Explosive
,ExplosiveFireball
,EyeOfEnder
,FallingBlock
,FireballEntity
,FireworkRocket
,Fish
,FishingBobber
,FluidStack
,Fox
,Furnace
,FurnaceBlockEntity
,FurnaceMinecart
,FusedExplosive
,Ghast
,Giant
,Golem
,Guardian
,Hanging
,Hoglin
,Hopper
,HopperMinecart
,Horse
,HorseLike
,Hostile
,Human
,Humanoid
,Husk
,Illager
,Illusioner
,IronGolem
,Item
,ItemFrame
,ItemStack
,Jigsaw
,Jukebox
,LeashKnot
,Lectern
,LightningBolt
,Living
,Llama
,LlamaLike
,LlamaSpit
,LocalPlayer
,MagmaCube
,Minecart
,MinecartLike
,MobSpawner
,Monster
,Mooshroom
,Mule
,NameableBlockEntity
,NameableCarrierBlockEntity
,Ocelot
,PackHorse
,Painting
,Panda
,Parrot
,Patroller
,Phantom
,Pig
,Piglin
,PiglinBrute
,PiglinLike
,Pillager
,Piston
,Player
,PolarBear
,Potion
,PrimedTNT
,Projectile
,Pufferfish
,Rabbit
,Raider
,Ranger
,Ravager
,RemotePlayer
,Salmon
,SchoolingFish
,ServerPlayer
,Sheep
,Shulker
,ShulkerBox
,ShulkerBullet
,Sign
,Silverfish
,Sittable
,Skeleton
,SkeletonHorse
,SkeletonLike
,Skull
,Slime
,SmallFireball
,Smoker
,Snowball
,SnowGolem
,Spawner
,SpawnerMinecart
,SpectralArrow
,Spellcaster
,Spider
,Squid
,Stray
,Strider
,StructureBlock
,TameableAnimal
,TameableHorse
,TNTMinecart
,Trader
,TraderLlama
,TrappedChest
,Trident
,TropicalFish
,Turtle
,Vehicle
,Vex
,Villager
,Vindicator
,WanderingTrader
,WeatherEffect
,Witch
,Wither
,WitherSkeleton
,WitherSkull
,Wolf
,Zoglin
,Zombie
,ZombieHorse
,ZombieLike
,ZombieVillager
,ZombifiedPiglin
- Enclosing interface:
- SerializableDataHolder
public static interface SerializableDataHolder.Mutable extends SerializableDataHolder, DataHolder.Mutable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SerializableDataHolder.Mutable
copy()
Creates a clone copy of thisCopyableDataHolder
as a newCopyableDataHolder
such that all theValue
s are safely duplicated to the new instance.void
setRawData(DataView container)
Attempts to set all data of thisDataHolder
according to theDataView
's held information.-
Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
-
-
-
-
Method Detail
-
setRawData
void setRawData(DataView container) throws InvalidDataException
Attempts to set all data of thisDataHolder
according to theDataView
's held information. Using this to modify known to beKey
s provided dynamically throughDataProvider
s is unsupported. The format of theDataView
's contained data is dependent on the type ofDataHolder.Mutable
this is. In some cases, the format is specified based on a more specific type, such as forEntityType
s, orItemType
s.This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts to validate the provided view is not always possible due to the nature of the data being parsed by the implementation, and only understood by clients. Other cases where the data can be validated and the data is incompatible will end up throwing an
InvalidDataException
.- Parameters:
container
- A container containing all raw data to set on this data holder- Throws:
InvalidDataException
- If the container is missing or has invalid data that this holder will refuse
-
copy
SerializableDataHolder.Mutable copy()
Description copied from interface:CopyableDataHolder
Creates a clone copy of thisCopyableDataHolder
as a newCopyableDataHolder
such that all theValue
s are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.- Specified by:
copy
in interfaceCopyableDataHolder
- Specified by:
copy
in interfaceSerializableDataHolder
- Returns:
- The new copy
-
-