Skip to content

Commit

Permalink
remove pointless parts of 'block ignites' event
Browse files Browse the repository at this point in the history
The block is always air... that's how minecraft fire works. Minecraft does not formally track what block the fire is attached to, it's just whatever solid blocks are touching it.
  • Loading branch information
mcmonkey4eva committed Nov 16, 2019
1 parent 85c94f2 commit 1a7c741
Showing 1 changed file with 2 additions and 8 deletions.
Expand Up @@ -15,7 +15,6 @@ public class BlockIgnitesScriptEvent extends BukkitScriptEvent implements Listen
// <--[event]
// @Events
// block ignites
// <material> ignites
//
// @Regex ^on [^\s]+ ignites$
//
Expand All @@ -29,8 +28,7 @@ public class BlockIgnitesScriptEvent extends BukkitScriptEvent implements Listen
// @Triggers when a block is set on fire.
//
// @Context
// <context.location> returns the LocationTag of the block was set on fire at.
// <context.material> returns the MaterialTag of the block that was set on fire.
// <context.location> returns the LocationTag of the block that was set on fire.
// <context.entity> returns the EntityTag of the entity that ignited the block.
// <context.origin_location> returns the LocationTag of the fire block that ignited this block.
// <context.cause> returns an ElementTag of the cause of the event: ENDER_CRYSTAL, EXPLOSION, FIREBALL, FLINT_AND_STEEL, LAVA, or SPREAD.
Expand Down Expand Up @@ -60,9 +58,6 @@ public boolean matches(ScriptPath path) {
if (!runGenericSwitchCheck(path, "cause", cause.asString())) {
return false;
}
if (!tryMaterial(material, path.eventArgLowerAt(0))) {
return false;
}
return super.matches(path);
}

Expand All @@ -77,7 +72,7 @@ public ObjectTag getContext(String name) {
return location;
}
else if (name.equals("material")) {
return material;
return new MaterialTag(event.getBlock());
}
else if (name.equals("entity") && event.getIgnitingEntity() != null) {
return new EntityTag(event.getIgnitingEntity());
Expand All @@ -94,7 +89,6 @@ else if (name.equals("cause")) {
@EventHandler
public void onBlockIgnites(BlockIgniteEvent event) {
location = new LocationTag(event.getBlock().getLocation());
material = new MaterialTag(event.getBlock());
cause = new ElementTag(event.getCause().name());
this.event = event;
fire(event);
Expand Down

0 comments on commit 1a7c741

Please sign in to comment.