GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.89k stars 272 forks source link

Implement EntityDamageByBlockEvent firing #1065

Open ytnoos opened 4 years ago

ytnoos commented 4 years ago

I created the new method getTouchingBlocks() to get every block a player was colliding with to put it on the EntityDamageByBlockEvent.

I created the canTakeDamage() method without any parameters to avoid code duplication on the new damageBlock() method.

I implemented[ damageBlock() method because default damage LivingEntity's method does not allow Blocks as a damage source.

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

mastercoms commented 4 years ago
[ERROR] src/main/java/net/glowstone/entity/GlowLivingEntity.java:[77] (imports) CustomImportOrder: Wrong lexicographical order for 'org.bukkit.event.entity.EntityDamageByBlockEvent' import. Should be before 'org.bukkit.event.entity.EntityDamageByEntityEvent'.
[ERROR] src/main/java/net/glowstone/entity/GlowLivingEntity.java:[1019] (coding) OverloadMethodsDeclarationOrder: Overload methods should not be split. Previous overloaded method located at line '965'.