api: update for tinted block and damage hitsplats

This commit is contained in:
Adam
2020-03-05 07:11:25 -05:00
parent b60d5428cf
commit 7c3ff105fb
3 changed files with 19 additions and 9 deletions

View File

@@ -37,13 +37,21 @@ public class Hitsplat
public enum HitsplatType public enum HitsplatType
{ {
/** /**
* Blocking damage (blue). * Blocking damage by me (blue).
*/ */
BLOCK, BLOCK_ME,
/** /**
* Taking damage (red). * Blocking damage by others (blue).
*/ */
DAMAGE, BLOCK_OTHER,
/**
* Taking damage by me (red).
*/
DAMAGE_ME,
/**
* Taking damage by others (red).
*/
DAMAGE_OTHER,
/** /**
* Damage from poison (green). * Damage from poison (green).
*/ */
@@ -72,8 +80,10 @@ public class Hitsplat
{ {
switch (type) switch (type)
{ {
case 0: return BLOCK; case 12: return BLOCK_ME;
case 1: return DAMAGE; case 13: return BLOCK_OTHER;
case 16: return DAMAGE_ME;
case 17: return DAMAGE_OTHER;
case 2: return POISON; case 2: return POISON;
case 4: return DISEASE; case 4: return DISEASE;
case 5: return VENOM; case 5: return VENOM;

View File

@@ -361,8 +361,8 @@ public class IdleNotifierPlugin extends Plugin
final Hitsplat hitsplat = event.getHitsplat(); final Hitsplat hitsplat = event.getHitsplat();
if (hitsplat.getHitsplatType() == Hitsplat.HitsplatType.DAMAGE if (hitsplat.getHitsplatType() == Hitsplat.HitsplatType.DAMAGE_ME
|| hitsplat.getHitsplatType() == Hitsplat.HitsplatType.BLOCK) || hitsplat.getHitsplatType() == Hitsplat.HitsplatType.BLOCK_ME)
{ {
lastCombatCountdown = HIGHEST_MONSTER_ATTACK_SPEED; lastCombatCountdown = HIGHEST_MONSTER_ATTACK_SPEED;
} }

View File

@@ -250,7 +250,7 @@ public class IdleNotifierPluginTest
// But player is being damaged (is in combat) // But player is being damaged (is in combat)
final HitsplatApplied hitsplatApplied = new HitsplatApplied(); final HitsplatApplied hitsplatApplied = new HitsplatApplied();
hitsplatApplied.setActor(player); hitsplatApplied.setActor(player);
hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE, 0, 0)); hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE_ME, 0, 0));
plugin.onHitsplatApplied(hitsplatApplied); plugin.onHitsplatApplied(hitsplatApplied);
plugin.onGameTick(new GameTick()); plugin.onGameTick(new GameTick());
verify(notifier, times(0)).notify(any()); verify(notifier, times(0)).notify(any());