Package com.minecolonies.core.colony.pvp
Class AttackingPlayer
java.lang.Object
com.minecolonies.core.colony.pvp.AttackingPlayer
Represents an attacking player.
-
Constructor Summary
ConstructorsConstructorDescriptionAttackingPlayer(net.minecraft.world.entity.player.Player player) Creates a new Attacking player. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddGuard(AbstractEntityCitizen guard) Adds a new guard to the list.booleanGetter for a copy of the guard list.net.minecraft.world.entity.player.PlayerGet the attacking player.inthashCode()static booleanisValidAttack(AbstractEntityCitizen citizen, Colony colony) Check if guard is part of valid attack.booleanisValidAttack(Colony colony) Check if the attack is valid.voidrefreshList(Colony colony) Refreshes the list and checks if all are still alive.voidremoveGuard(AbstractEntityCitizen guard) Removes a guard to the list.
-
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
Check if guard is part of valid attack.- Parameters:
citizen- the attacking guard.colony- the colony.- Returns:
- true if so.
-
getGuards
Getter for a copy of the guard list.- Returns:
- an immutable copy the list.
-
addGuard
Adds a new guard to the list.- Parameters:
guard- the guard to add.- Returns:
- true if successful
-
isValidAttack
Check if the attack is valid.- Parameters:
colony- the colony to check for.- Returns:
- true if so.
-
removeGuard
Removes a guard to the list.- Parameters:
guard- the guard to remove.
-
refreshList
Refreshes the list and checks if all are still alive.- Parameters:
colony- the colony to refresh it for.
-
equals
-
hashCode
public int hashCode()
-