public class PlayerDataHandler
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PlayerDataHandler.DefaultStageData
The default implementation of IStageData.
|
static interface |
PlayerDataHandler.IStageData
This is the backing interface for the custom player data.
|
static class |
PlayerDataHandler.Storage
This class handles the read/write of NBT in capabilities.
|
| Modifier and Type | Field and Description |
|---|---|
static net.minecraftforge.common.capabilities.Capability<PlayerDataHandler.IStageData> |
CAPABILITY
A reference to the capability.
|
| Constructor and Description |
|---|
PlayerDataHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachCapabilities(net.minecraftforge.event.AttachCapabilitiesEvent<net.minecraft.entity.Entity> event)
This event is used to attach the data to the player.
|
void |
clonePlayer(net.minecraftforge.event.entity.player.PlayerEvent.Clone event)
This event is used to make player data persist after death.
|
static PlayerDataHandler.IStageData |
getStageData(net.minecraft.entity.player.EntityPlayer player)
Gets the stage data for a player.
|
void |
onEntityJoinWorld(net.minecraftforge.event.entity.EntityJoinWorldEvent event)
This event is used to sync stage data initially.
|
public static final net.minecraftforge.common.capabilities.Capability<PlayerDataHandler.IStageData> CAPABILITY
public static PlayerDataHandler.IStageData getStageData(@Nonnull net.minecraft.entity.player.EntityPlayer player)
player - The player to get stage data from.public void attachCapabilities(net.minecraftforge.event.AttachCapabilitiesEvent<net.minecraft.entity.Entity> event)
public void onEntityJoinWorld(net.minecraftforge.event.entity.EntityJoinWorldEvent event)
public void clonePlayer(net.minecraftforge.event.entity.player.PlayerEvent.Clone event)