Class HackableSquid

java.lang.Object
me.desht.pneumaticcraft.common.hacking.entity.HackableSquid
All Implemented Interfaces:
IHackableEntity

public class HackableSquid extends Object implements IHackableEntity
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addHackInfo(net.minecraft.world.entity.Entity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
    Add info that is displayed on the tracker tooltip here.
    void
    addPostHackInfo(net.minecraft.world.entity.Entity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
    Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true.
    boolean
    afterHackTick(net.minecraft.world.entity.Entity entity)
    Called every tick after the hacking finished.
    boolean
    canHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
    Returning true will allow the player to hack this entity.
    @Nullable net.minecraft.resources.ResourceLocation
    Should return a unique id to represent this hackable.
    int
    getHackTime(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
    Return the time it takes to hack this entity in ticks.
    void
    onHackFinished(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
    Called when a player successfully hacks an entity; basically getHackTime(Entity) ticks after the hack was initiated.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HackableSquid

      public HackableSquid()
  • Method Details

    • getHackableId

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getHackableId()
      Description copied from interface: IHackableEntity
      Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart. Null is a valid return: afterHackTick will not be triggered at all in that case.
      Specified by:
      getHackableId in interface IHackableEntity
      Returns:
      a unique String id
    • 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.
      Specified by:
      canHack in interface IHackableEntity
      Parameters:
      entity - the potential hacking target
      player - the player who is looking at the entity
    • addHackInfo

      public void addHackInfo(net.minecraft.world.entity.Entity 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 tracker tooltip here. Text like "Hack to explode" can be added. This method is only called when canHack(Entity) returned true.
      Specified by:
      addHackInfo in interface IHackableEntity
      Parameters:
      entity - the potential hack target
      curInfo - a text component list to append info to
      player - the player who is looking at the entity
    • addPostHackInfo

      public void addPostHackInfo(net.minecraft.world.entity.Entity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true. Things like "Neutralized".
      Specified by:
      addPostHackInfo in interface IHackableEntity
      Parameters:
      entity - the hacked entity
      curInfo - a text component list to append info to
      player - the player who has hacked the entity
    • getHackTime

      public int getHackTime(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Return the time it takes to hack this entity in ticks. For more powerful hacks, a longer required hacking time is recommended.
      Specified by:
      getHackTime in interface IHackableEntity
      Parameters:
      entity - the potential hack target
      player - the player who is looking at the entity
    • onHackFinished

      public void onHackFinished(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Called when a player successfully hacks an entity; basically getHackTime(Entity) ticks after the hack was initiated.
      Specified by:
      onHackFinished in interface IHackableEntity
      Parameters:
      entity - the hacked entity
      player - the player who has hacked the entity
    • afterHackTick

      public boolean afterHackTick(net.minecraft.world.entity.Entity entity)
      Description copied from interface: IHackableEntity
      Called every tick after the hacking finished. Returning true will keep this going (e.g. for endermen, to suppress their teleportation) or false for one-shot hacks (e.g. hacking a cow turns it into a mooshroom, and that is all)
      Specified by:
      afterHackTick in interface IHackableEntity
      Parameters:
      entity - the hacked entity