Skip to content

Commit 1c18a1a

Browse files
committed
added missing check (fixes #2)
1 parent f0ec409 commit 1c18a1a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>lol.hyper</groupId>
2525
<artifactId>toolstats</artifactId>
26-
<version>1.2</version>
26+
<version>1.2.1</version>
2727
<packaging>jar</packaging>
2828

2929
<name>ToolStats</name>

src/main/java/lol/hyper/toolstats/events/EntityDamage.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ public void onDamage(EntityDamageEvent event) {
140140

141141
@EventHandler
142142
public void onDamage(EntityDamageByBlockEvent event) {
143+
if (!(event.getEntity() instanceof LivingEntity)) {
144+
return;
145+
}
143146
LivingEntity livingEntity = (LivingEntity) event.getEntity();
144147
if (livingEntity instanceof Player) {
145148
Player player = (Player) livingEntity;

0 commit comments

Comments
 (0)