Class PokeGiftTileEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.pixelmonmod.pixelmon.blocks.tileentity.PokeGiftTileEntity
- All Implemented Interfaces:
net.neoforged.neoforge.attachment.IAttachmentHolder
,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
public class PokeGiftTileEntity
extends net.minecraft.world.level.block.entity.BlockEntity
Tile entity for a Poké Gift.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField
-
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionPokeGiftTileEntity
(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) PokeGiftTileEntity
(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClaimer
(UUID playerID) Registers a player who has claimed the Poké Gift.boolean
Checks if a player can claim the Poké Gift.boolean
Gets whether the chest can only be claimed once before disappearing.boolean
Gets whether the chest can only be claimed once per player.Gets the Poké Gift's type.getLootClaim
(UUID playerID) Gets the identifier for a player who has claimed the Poké Gift.getOwner()
Gets the UUID of the Poké Gift's owner.Gets the Pokémon inside the Poké Gift.Gets a copy of the Pokémon inside the Poké Gift.Gets the special Pokémon inside the Poké Gift.net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
net.minecraft.nbt.CompoundTag
getUpdateTag
(net.minecraft.core.HolderLookup.Provider registryAccess) Gets the visibility setting of the Poké Gift.boolean
isUsableByPlayer
(net.minecraft.world.entity.player.Player player) Checks if a player is close enough to interact with the Poké Gift.void
loadAdditional
(net.minecraft.nbt.CompoundTag tagger, net.minecraft.core.HolderLookup.Provider registryAccess) void
removeClaimer
(UUID playerID) Removes a player from the list of players who have claimed the Poké Gift.void
saveAdditional
(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registryAccess) void
setAllSpecialPixelmon
(List<PokemonSpecification> pixelmon) Sets the special Pokémon inside the Poké Gift.void
setChestOneTime
(boolean val) Sets whether the chest can only be claimed once before disappearing.void
setDropOneTime
(boolean val) Sets whether the chest can only be claimed once per player.void
Sets the UUID of the Poké Gift's owner.void
setPokemon
(Pokemon pokemon) Sets the Pokémon inside the Poké Gift.void
setSpecialPixelmon
(PokemonSpecification pixelmon) Adds a special Pokémon to the Poké Gift.void
Sets the Poké Gift's type.void
setVisibility
(EnumPokechestVisibility visible) Sets the visibility setting of the Poké Gift.boolean
Checks if claiming the Poké Gift will make it disappear.Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Constructor Details
-
PokeGiftTileEntity
public PokeGiftTileEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) -
PokeGiftTileEntity
public PokeGiftTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
-
-
Method Details
-
setOwner
Sets the UUID of the Poké Gift's owner.- Parameters:
id
- The UUID of the Poké Gift's owner.
-
getOwner
Gets the UUID of the Poké Gift's owner.- Returns:
- The UUID of the Poké Gift's owner.
-
setType
Sets the Poké Gift's type.- Parameters:
t
- The Poké Gift's type.
-
getGiftType
Gets the Poké Gift's type.- Returns:
- The Poké Gift's type.
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registryAccess) - Overrides:
saveAdditional
in classnet.minecraft.world.level.block.entity.BlockEntity
-
loadAdditional
public void loadAdditional(net.minecraft.nbt.CompoundTag tagger, net.minecraft.core.HolderLookup.Provider registryAccess) - Overrides:
loadAdditional
in classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacket
in classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider registryAccess) - Overrides:
getUpdateTag
in classnet.minecraft.world.level.block.entity.BlockEntity
-
canClaim
Checks if a player can claim the Poké Gift.- Parameters:
playerID
- The UUID of the player attempting to claim the Poké Gift.- Returns:
- Whether the player can claim the Poké Gift.
-
getLootClaim
Gets the identifier for a player who has claimed the Poké Gift.- Parameters:
playerID
- The UUID of the player attempting to claim the Poké Gift.- Returns:
- The identifier for the player who is attempting to claim the Poké Gift, or null if the player has not claimed the Poké Gift.
-
addClaimer
Registers a player who has claimed the Poké Gift.- Parameters:
playerID
- The UUID of the player who has claimed the Poké Gift.
-
removeClaimer
Removes a player from the list of players who have claimed the Poké Gift.- Parameters:
playerID
- The UUID of the player to remove.
-
shouldBreakBlock
public boolean shouldBreakBlock()Checks if claiming the Poké Gift will make it disappear.- Returns:
- Whether claiming the Poké Gift will make it disappear.
-
setChestOneTime
public void setChestOneTime(boolean val) Sets whether the chest can only be claimed once before disappearing.- Parameters:
val
- Whether the chest can only be claimed once before disappearing.
-
getChestMode
public boolean getChestMode()Gets whether the chest can only be claimed once before disappearing.- Returns:
- Whether the chest can only be claimed once before disappearing.
-
setDropOneTime
public void setDropOneTime(boolean val) Sets whether the chest can only be claimed once per player.- Parameters:
val
- Whether the chest can only be claimed once per player.
-
getDropMode
public boolean getDropMode()Gets whether the chest can only be claimed once per player.- Returns:
- Whether the chest can only be claimed once per player.
-
isUsableByPlayer
public boolean isUsableByPlayer(net.minecraft.world.entity.player.Player player) Checks if a player is close enough to interact with the Poké Gift.- Parameters:
player
- The player attempting to interact with the Poké Gift.- Returns:
- Whether the player is close enough to interact with the Poké Gift.
-
getPokemon
Gets the Pokémon inside the Poké Gift.- Returns:
- The Pokémon inside the Poké Gift.
-
getPokemonCopy
Gets a copy of the Pokémon inside the Poké Gift.- Returns:
- The Pokémon inside the Poké Gift.
-
setPokemon
Sets the Pokémon inside the Poké Gift.- Parameters:
pokemon
- The Pokémon inside the Poké Gift.
-
getSpecialPixelmon
Gets the special Pokémon inside the Poké Gift.- Returns:
- The special Pokémon inside the Poké Gift.
-
setAllSpecialPixelmon
Sets the special Pokémon inside the Poké Gift.- Parameters:
pixelmon
- The special Pokémon inside the Poké Gift.
-
setSpecialPixelmon
Adds a special Pokémon to the Poké Gift.- Parameters:
pixelmon
- The special Pokémon to put inside the Poké Gift.
-
getVisibility
Gets the visibility setting of the Poké Gift.- Returns:
- The visibility setting of the Poké Gift.
-
setVisibility
Sets the visibility setting of the Poké Gift.- Parameters:
visible
- The visibility setting of the Poké Gift.
-