Class HackableHorse

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

public class HackableHorse extends HackableTameable
Horses, although tameable animals, don't extend TamableAnimal. Yay.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    net.minecraft.resources.ResourceLocation
    Should return a unique id to represent this hackable.
    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 me.desht.pneumaticcraft.common.hacking.entity.HackableTameable

    addHackInfo, addPostHackInfo, afterHackTick, getHackTime

    Methods inherited from class java.lang.Object

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

    • HackableHorse

      public HackableHorse()
  • Method Details

    • getHackableId

      public 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
      Overrides:
      getHackableId in class HackableTameable
      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
      Overrides:
      canHack in class HackableTameable
      Parameters:
      entity - the potential hacking 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
      Overrides:
      onHackFinished in class HackableTameable
      Parameters:
      entity - the hacked entity
      player - the player who has hacked the entity