Class AttackingPlayer

java.lang.Object
com.minecolonies.core.colony.pvp.AttackingPlayer

public class AttackingPlayer extends Object
Represents an attacking player.
  • Constructor Details

    • AttackingPlayer

      public AttackingPlayer(net.minecraft.world.entity.player.Player player)
      Creates a new Attacking player.
      Parameters:
      player - the attacking player.
  • Method Details

    • getPlayer

      public net.minecraft.world.entity.player.Player getPlayer()
      Get the attacking player.
      Returns:
      the PlayerEntity.
    • isValidAttack

      public static boolean isValidAttack(AbstractEntityCitizen citizen, Colony colony)
      Check if guard is part of valid attack.
      Parameters:
      citizen - the attacking guard.
      colony - the colony.
      Returns:
      true if so.
    • getGuards

      public List<AbstractEntityCitizen> getGuards()
      Getter for a copy of the guard list.
      Returns:
      an immutable copy the list.
    • addGuard

      public boolean addGuard(AbstractEntityCitizen guard)
      Adds a new guard to the list.
      Parameters:
      guard - the guard to add.
      Returns:
      true if successful
    • isValidAttack

      public boolean isValidAttack(Colony colony)
      Check if the attack is valid.
      Parameters:
      colony - the colony to check for.
      Returns:
      true if so.
    • removeGuard

      public void removeGuard(AbstractEntityCitizen guard)
      Removes a guard to the list.
      Parameters:
      guard - the guard to remove.
    • refreshList

      public void refreshList(Colony colony)
      Refreshes the list and checks if all are still alive.
      Parameters:
      colony - the colony to refresh it for.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object