public class CravingDataHandler
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CravingDataHandler.Default
Default implementation of the custom data.
|
static interface |
CravingDataHandler.ICustomData
Interface for holding various getter and setter methods.
|
static class |
CravingDataHandler.Provider
Handles all the checks and delegate methods for the capability.
|
static class |
CravingDataHandler.Storage
Handles reand/write of custom data.
|
Modifier and Type | Field and Description |
---|---|
static net.minecraftforge.common.capabilities.Capability<CravingDataHandler.ICustomData> |
CUSTOM_DATA |
Constructor and Description |
---|
CravingDataHandler() |
Modifier and Type | Method and Description |
---|---|
void |
attachCapabilities(net.minecraftforge.event.AttachCapabilitiesEvent<net.minecraft.entity.Entity> event) |
void |
clonePlayer(net.minecraftforge.event.entity.player.PlayerEvent.Clone event)
This event is used to make player data persist after death.
|
static CravingDataHandler.ICustomData |
getStageData(net.minecraft.entity.player.EntityPlayer player) |
static void |
init() |
void |
onEntityJoinWorld(net.minecraftforge.event.entity.EntityJoinWorldEvent event)
This event is used to sync stage data initially.
|
static void |
setCravingData(net.minecraft.entity.player.EntityPlayer player,
ICraving craving,
int time) |
public static final net.minecraftforge.common.capabilities.Capability<CravingDataHandler.ICustomData> CUSTOM_DATA
public static void init()
public static CravingDataHandler.ICustomData getStageData(@Nonnull net.minecraft.entity.player.EntityPlayer player)
public static void setCravingData(net.minecraft.entity.player.EntityPlayer player, ICraving craving, int time)
public void attachCapabilities(net.minecraftforge.event.AttachCapabilitiesEvent<net.minecraft.entity.Entity> event)
public void clonePlayer(net.minecraftforge.event.entity.player.PlayerEvent.Clone event)
public void onEntityJoinWorld(net.minecraftforge.event.entity.EntityJoinWorldEvent event)