public class HackableMobSpawner extends java.lang.Object implements IHackableBlock
| Constructor and Description |
|---|
HackableMobSpawner() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInfo(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
Add info that is displayed on the tracker tooltip here.
|
void |
addPostHackInfo(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
Add info to be displayed on the HUD after hacking is complete, as long as
IHackableBlock.afterHackTick(IBlockReader, BlockPos) continues to returning true, e.g. |
boolean |
afterHackTick(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos)
Called every tick after the hacking finished (on both server and client side).
|
boolean |
canHack(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
Returning true will allow the player to hack this block.
|
net.minecraft.util.ResourceLocation |
getHackableId()
Get a unique id to represent this hackable.
|
int |
getHackTime(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
Get the time it takes to hack this block in ticks.
|
static boolean |
isHacked(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos) |
void |
onHackComplete(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
When the player has been hacking the block for
IHackableBlock.getHackTime(IBlockReader, BlockPos, PlayerEntity) ticks,
this will be called on both server and client side. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfakeRayTracepublic net.minecraft.util.ResourceLocation getHackableId()
IHackableBlockThe returned ResourceLocation should be in the namespace of the mod which adds the hack (which is not necessarily the mod that adds the hackable block).
CURRENTLY THIS ISN'T IMPLEMENTED.
getHackableId in interface IHackableBlockpublic boolean canHack(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
IHackableBlockcanHack in interface IHackableBlockworld - the worldpos - the block posplayer - the player observing the blockpublic static boolean isHacked(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos)
public void addInfo(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
IHackableBlockIHackableBlock.canHack(IBlockReader, BlockPos, PlayerEntity) has returned true.
Keep this message short; one short sentence is enough.addInfo in interface IHackableBlockworld - the worldpos - the block pos of the to-be-hacked blockcurInfo - text component list to add info toplayer - the player observing the hackable blockpublic void addPostHackInfo(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player)
IHackableBlockIHackableBlock.afterHackTick(IBlockReader, BlockPos) continues to returning true, e.g. "Spawner Disabled".
Keep this message short; one short sentence or even a couple of words is enough.addPostHackInfo in interface IHackableBlockworld - the worldpos - the block pos of the hacked blockcurInfo - text component list to add info toplayer - the player observing the hacked blockpublic int getHackTime(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
IHackableBlockgetHackTime in interface IHackableBlockworld - the worldpos - the block posplayer - the player observing the hackable blockpublic void onHackComplete(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player)
IHackableBlockIHackableBlock.getHackTime(IBlockReader, BlockPos, PlayerEntity) ticks,
this will be called on both server and client side.onHackComplete in interface IHackableBlockworld - the worldpos - the block posplayer - the player observing the hacked blockpublic boolean afterHackTick(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos)
IHackableBlockCURRENTLY THIS METHOD WILL STOP GETTING INVOKED AFTER A SERVER RESTART!
afterHackTick in interface IHackableBlockworld - the worldpos - the block pos