Class RangedEntityAttackMatcher

java.lang.Object
org.hamcrest.BaseMatcher<MockRangedEntity<? extends MobMock>>
org.hamcrest.TypeSafeMatcher<MockRangedEntity<? extends MobMock>>
org.mockbukkit.mockbukkit.matcher.entity.ranged.RangedEntityAttackMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<MockRangedEntity<? extends MobMock>>, org.hamcrest.SelfDescribing

public class RangedEntityAttackMatcher extends org.hamcrest.TypeSafeMatcher<MockRangedEntity<? extends MobMock>>
  • Constructor Details

    • RangedEntityAttackMatcher

      public RangedEntityAttackMatcher(LivingEntity target, float charge, boolean aggressive)
  • Method Details

    • matchesSafely

      protected boolean matchesSafely(MockRangedEntity<? extends MobMock> mockRangedEntity)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<MockRangedEntity<? extends MobMock>>
    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatchSafely

      protected void describeMismatchSafely(MockRangedEntity<? extends MobMock> mockRangedEntity, org.hamcrest.Description description)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<MockRangedEntity<? extends MobMock>>
    • hasAttacked

      @NotNull public static @NotNull RangedEntityAttackMatcher hasAttacked(@NotNull @NotNull LivingEntity target, float charge)
      Parameters:
      target - The required target
      charge - The required charge
      Returns:
      A matcher which matches with any ranged entity that has attacked the specified target with the specified charge
    • hasAttacked

      @NotNull public static @NotNull RangedEntityAttackMatcher hasAttacked(@NotNull @NotNull LivingEntity target, float charge, boolean aggressive)
      Parameters:
      target - The required target
      charge - The required charge
      aggressive - Whether a check for aggressiveness should be done
      Returns:
      A matcher which matches with any ranged entity that has attacked the specified target with the specified charge while being aggressive
    • hasNotAttacked

      @NotNull public static @NotNull org.hamcrest.Matcher<MockRangedEntity<? extends MobMock>> hasNotAttacked(@NotNull @NotNull LivingEntity target, float charge)
      Parameters:
      target - The required target for no match
      charge - The required charge for no match
      Returns:
      A matcher which matches with any ranged entity that has not attacked the specified target with the specified charge
    • hasNotAttacked

      @NotNull public static @NotNull org.hamcrest.Matcher<MockRangedEntity<? extends MobMock>> hasNotAttacked(@NotNull @NotNull LivingEntity target, float charge, boolean aggressive)
      Parameters:
      target - The required target for no match
      charge - The required charge for no match
      aggressive - Whether a check for aggressiveness should be done
      Returns:
      A matcher which matches with any ranged entity that has not attacked the specified target with the specified charge while being aggressive