Created
January 9, 2012 00:44
-
-
Save EdGruberman/1580299 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in an EntityListener: | |
@Override | |
public void onEntityCombust(final EntityCombustEvent event) { | |
if (event.isCancelled() || !(event.getEntity() instanceof Player)) return; | |
DamageReport.recordCombuster(event); | |
} | |
in DamageReport: | |
static void recordCombuster(final EntityCombustEvent event) { | |
if (event instanceof EntityCombustByEntityEvent) { | |
EntityCombustByEntityEvent byEntity = (EntityCombustByEntityEvent) event; | |
DamageReport.combuster.put(event.getEntity(), DamageReport.describeEntity(byEntity.getCombuster())); | |
return; | |
} | |
System.out.println(event instanceof EntityCombustByBlockEvent); | |
if (event instanceof EntityCombustByBlockEvent) { | |
EntityCombustByBlockEvent byBlock = (EntityCombustByBlockEvent) event; | |
DamageReport.combuster.put(event.getEntity(), DamageReport.describeMaterial(byBlock.getCombuster().getState().getData())); | |
return; | |
} | |
} | |
when a Player walks into lava and back out again, in console: | |
2012-01-08 17:41:15 [INFO] false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment