Class AbstractTameableHack<T extends net.minecraft.world.entity.LivingEntity>

java.lang.Object
me.desht.pneumaticcraft.common.hacking.entity.AbstractTameableHack<T>
Type Parameters:
T -
All Implemented Interfaces:
IHackableEntity<T>
Direct Known Subclasses:
HackableHorse, HackableTameable

public abstract class AbstractTameableHack<T extends net.minecraft.world.entity.LivingEntity> extends Object implements IHackableEntity<T>
Common base for all tamable entities. And horses, which Mojang have, for some reason, decided are special -_-
  • Constructor Details

    • AbstractTameableHack

      public AbstractTameableHack()
  • Method Details

    • canHack

      public boolean canHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Returning true will allow the player to hack this entity. This can be used to only allow hacking under certain conditions. Default implementation just checks the entity's class is appropriate and the entity is alive, but this can be overridden to add extract checks. Just be sure to call this super method in your overridden method.
      Specified by:
      canHack in interface IHackableEntity<T extends net.minecraft.world.entity.LivingEntity>
      Parameters:
      entity - the potential hacking target
      player - the player who is potentially hacking the target entity
    • addHackInfo

      public void addHackInfo(T entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Add info that is displayed on the entity tracker panel, describing what the hack would do to the entity. This is only called if IHackableEntity.canHack(Entity, Player) returned true. Keep this message short; one short phrase is enough.
      Specified by:
      addHackInfo in interface IHackableEntity<T extends net.minecraft.world.entity.LivingEntity>
      Parameters:
      entity - the potential hack target
      curInfo - a text component list to append info to
      player - the player who is potentially hacking the target entity
    • addPostHackInfo

      public void addPostHackInfo(T entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Add 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:
      addPostHackInfo in interface IHackableEntity<T extends net.minecraft.world.entity.LivingEntity>
      Parameters:
      entity - the hacked target
      curInfo - a text component list to append info to
      player - the player who has hacked the entity
    • getHackTime

      public int getHackTime(T entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Return 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:
      getHackTime in interface IHackableEntity<T extends net.minecraft.world.entity.LivingEntity>
      Parameters:
      entity - the potential hack target
      player - the player who is potentially hacking the target entity