Class ConjureDataHolder
java.lang.Object
com.binaris.wizardry.capabilities.ConjureDataHolder
- All Implemented Interfaces:
ConjureData,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
public class ConjureDataHolder
extends Object
implements net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, ConjureData
Loading the conjure data with Forge, nothing too crazy over here, just using the capabilities to load-change the data
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraftforge.common.capabilities.Capability<ConjureDataHolder>static final net.minecraft.resources.ResourceLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(net.minecraft.nbt.CompoundTag tag) intGets the duration this item was conjured for (for display purposes).longGets the absolute game time when this conjured item should expire.booleanChecks whether this item was conjured.net.minecraft.nbt.CompoundTagvoidsetDuration(int duration) Sets the duration this item was conjured for (for display purposes).voidsetExpireTime(long expireTime) Sets the absolute game time when this conjured item should expire.voidsetSummoned(boolean summoned) Sets whether this item was conjured.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.binaris.wizardry.api.content.data.ConjureData
getRemainingLifetime, hasExpired
-
Field Details
-
LOCATION
public static final net.minecraft.resources.ResourceLocation LOCATION -
INSTANCE
-
-
Constructor Details
-
ConjureDataHolder
public ConjureDataHolder()
-
-
Method Details
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
getExpireTime
public long getExpireTime()Description copied from interface:ConjureDataGets the absolute game time when this conjured item should expire.- Specified by:
getExpireTimein interfaceConjureData- Returns:
- the expire time in game ticks, or -1 if not set
-
setExpireTime
public void setExpireTime(long expireTime) Description copied from interface:ConjureDataSets the absolute game time when this conjured item should expire.- Specified by:
setExpireTimein interfaceConjureData- Parameters:
expireTime- the expire time in game ticks
-
getDuration
public int getDuration()Description copied from interface:ConjureDataGets the duration this item was conjured for (for display purposes).- Specified by:
getDurationin interfaceConjureData- Returns:
- the duration in ticks
-
setDuration
public void setDuration(int duration) Description copied from interface:ConjureDataSets the duration this item was conjured for (for display purposes).- Specified by:
setDurationin interfaceConjureData- Parameters:
duration- the duration in ticks
-
isSummoned
public boolean isSummoned()Description copied from interface:ConjureDataChecks whether this item was conjured.- Specified by:
isSummonedin interfaceConjureData- Returns:
- true if the item was conjured
-
setSummoned
public void setSummoned(boolean summoned) Description copied from interface:ConjureDataSets whether this item was conjured.- Specified by:
setSummonedin interfaceConjureData- Parameters:
summoned- true if the item was conjured
-