Class HackableBat
java.lang.Object
me.desht.pneumaticcraft.common.hacking.entity.HackableBat
- All Implemented Interfaces:
IHackableEntity<net.minecraft.world.entity.ambient.Bat>
public class HackableBat
extends Object
implements IHackableEntity<net.minecraft.world.entity.ambient.Bat>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHackInfo(net.minecraft.world.entity.ambient.Bat entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player) Add info that is displayed on the entity tracker panel, describing what the hack would do to the entity.voidaddPostHackInfo(net.minecraft.world.entity.ambient.Bat entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player) Add info that is displayed on the entity tracker panel, describing what the hack has done to the entity.Class<net.minecraft.world.entity.ambient.Bat>Get the class of the entity this hack should apply to.net.minecraft.resources.ResourceLocationShould return a unique id to represent this hackable.intgetHackTime(net.minecraft.world.entity.ambient.Bat entity, net.minecraft.world.entity.player.Player player) Return the time it takes to hack this entity in ticks.voidonHackFinished(net.minecraft.world.entity.ambient.Bat entity, net.minecraft.world.entity.player.Player player) Called when a player successfully hacks an entity; basicallygetHackTime(Entity)ticks after the hack was initiated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.pneumatic_armor.hacking.IHackableEntity
_addHackInfo, _addPostHackInfo, _afterHackTick, _getHackTime, _onHackFinished, afterHackTick, canHack
-
Constructor Details
-
HackableBat
public HackableBat()
-
-
Method Details
-
getHackableId
public net.minecraft.resources.ResourceLocation getHackableId()Description copied from interface:IHackableEntityShould return a unique id to represent this hackable.- Specified by:
getHackableIdin interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Returns:
- a unique String id
-
getHackableClass
Description copied from interface:IHackableEntityGet the class of the entity this hack should apply to. All subclasses of this class will also be applicable.- Specified by:
getHackableClassin interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Returns:
- the target entity class
-
addHackInfo
public void addHackInfo(net.minecraft.world.entity.ambient.Bat entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityAdd info that is displayed on the entity tracker panel, describing what the hack would do to the entity. This is only called ifIHackableEntity.canHack(Entity, Player)returned true. Keep this message short; one short phrase is enough.- Specified by:
addHackInfoin interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Parameters:
entity- the potential hack targetcurInfo- a text component list to append info toplayer- the player who is potentially hacking the target entity
-
addPostHackInfo
public void addPostHackInfo(net.minecraft.world.entity.ambient.Bat entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityAdd info that is displayed on the entity tracker panel, describing what the hack has done to the entity. This is displayed for a second or so after the hack completes.- Specified by:
addPostHackInfoin interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Parameters:
entity- the hacked targetcurInfo- a text component list to append info toplayer- the player who has hacked the entity
-
getHackTime
public int getHackTime(net.minecraft.world.entity.ambient.Bat entity, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityReturn the time it takes to hack this entity in ticks. Most builtin PneumaticCraft hacks use a time of 60 ticks, but for more powerful hacks, a longer required hacking time is suggested.- Specified by:
getHackTimein interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Parameters:
entity- the potential hack targetplayer- the player who is potentially hacking the target entity
-
onHackFinished
public void onHackFinished(net.minecraft.world.entity.ambient.Bat entity, net.minecraft.world.entity.player.Player player) Description copied from interface:IHackableEntityCalled when a player successfully hacks an entity; basicallygetHackTime(Entity)ticks after the hack was initiated.- Specified by:
onHackFinishedin interfaceIHackableEntity<net.minecraft.world.entity.ambient.Bat>- Parameters:
entity- the hacked entityplayer- the player who has hacked the entity
-