Class MysteryBoxEvent.Open.Post
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open.Post
- Enclosing class:
- MysteryBoxEvent.Open
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
MysteryBoxEvent.Open.Post, MysteryBoxEvent.Open.Pre
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
MysteryBoxEvent.Activate, MysteryBoxEvent.ComparatorPower, MysteryBoxEvent.Feed, MysteryBoxEvent.Open, MysteryBoxEvent.Tick
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
ConstructorDescriptionPost
(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, long lastOpenTime, long openUntil, long nextOpenTime, int scrapsTotal, int scrapsLeft) Fired when a Mystery Box has been opened, and its variables are being updated from that process. -
Method Summary
Modifier and TypeMethodDescriptionlong
The Unix time in milliseconds when this Mystery Box was last opened (in this case, right now).long
The Unix time in milliseconds when this Mystery Box can next be opened.long
The Unix time in milliseconds until this Mystery Box will be open for.int
The new value of the counter for Netherite Scraps required to open this Mystery Box again.int
The new count of Netherite Scraps required to open this Mystery Box again.void
setLastOpenTime
(long lastOpenTime) Sets the Unix time in milliseconds when this Mystery Box was last opened.void
setNextOpenTime
(long nextOpenTime) Sets the Unix time in milliseconds when this Mystery Box can next be opened.void
setOpenUntil
(long openUntil) Sets the Unix time in milliseconds until this Mystery Box will be open for.void
setScrapsLeft
(int scrapsLeft) Sets the new value of the counter for Netherite Scraps required to open this Mystery Box again.void
setScrapsTotal
(int scrapsTotal) Sets the new count of Netherite Scraps required to open this Mystery Box again.Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
getItemStack, getPlayer
Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
getBlockState, getBox
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
Post
public Post(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, long lastOpenTime, long openUntil, long nextOpenTime, int scrapsTotal, int scrapsLeft) Fired when a Mystery Box has been opened, and its variables are being updated from that process.- Parameters:
box
- The Mystery Box tile entity.player
- The player instigating this event.blockState
- The block state of this Mystery Box.itemStack
- The item stack being used in this interaction.lastOpenTime
- The Unix time in milliseconds when this Mystery Box was last opened (in this case, right now).openUntil
- The Unix time in milliseconds until this Mystery Box will be open for.nextOpenTime
- The Unix time in milliseconds when this Mystery Box can next be opened.scrapsTotal
- The new count of Netherite Scraps required to open this Mystery Box again.scrapsLeft
- The new value of the counter for Netherite Scraps required to open this Mystery Box again.
-
-
Method Details
-
getLastOpenTime
public long getLastOpenTime()The Unix time in milliseconds when this Mystery Box was last opened (in this case, right now).- Returns:
- The last open time (ms).
-
setLastOpenTime
public void setLastOpenTime(long lastOpenTime) Sets the Unix time in milliseconds when this Mystery Box was last opened.- Parameters:
lastOpenTime
- The last open time (ms).
-
getOpenUntil
public long getOpenUntil()The Unix time in milliseconds until this Mystery Box will be open for.- Returns:
- The open until time (ms).
-
setOpenUntil
public void setOpenUntil(long openUntil) Sets the Unix time in milliseconds until this Mystery Box will be open for.- Parameters:
openUntil
- The open until time (ms).
-
getNextOpenTime
public long getNextOpenTime()The Unix time in milliseconds when this Mystery Box can next be opened.- Returns:
- The next open time (ms).
-
setNextOpenTime
public void setNextOpenTime(long nextOpenTime) Sets the Unix time in milliseconds when this Mystery Box can next be opened.- Parameters:
nextOpenTime
- The next open time (ms).
-
getScrapsTotal
public int getScrapsTotal()The new count of Netherite Scraps required to open this Mystery Box again.- Returns:
- The total scraps required.
-
setScrapsTotal
public void setScrapsTotal(int scrapsTotal) Sets the new count of Netherite Scraps required to open this Mystery Box again.- Parameters:
scrapsTotal
- The total scraps required.
-
getScrapsLeft
public int getScrapsLeft()The new value of the counter for Netherite Scraps required to open this Mystery Box again.- Returns:
- The value of the scrap counter.
-
setScrapsLeft
public void setScrapsLeft(int scrapsLeft) Sets the new value of the counter for Netherite Scraps required to open this Mystery Box again.- Parameters:
scrapsLeft
- The value of the scrap counter.
-