Skip to content

Commit

Permalink
cleanups on that PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 25, 2022
1 parent 525df9f commit c81a86b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Expand Up @@ -106,7 +106,6 @@ public static void registerMainEvents() {
ScriptEvent.registerScriptEvent(EntityDeathScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityDespawnScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityDropsItemScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityEntersBlockScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityEntersPortalScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityEntersVehicleScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityExitsPortalScriptEvent.class);
Expand All @@ -116,6 +115,7 @@ public static void registerMainEvents() {
ScriptEvent.registerScriptEvent(EntityFoodLevelChangeScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityFormsBlockScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityGlideScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityGoesIntoBlockScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityHealsScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityInteractScriptEvent.class);
ScriptEvent.registerScriptEvent(EntityKilledScriptEvent.class);
Expand Down
Expand Up @@ -11,7 +11,7 @@
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityEnterBlockEvent;

public class EntityEntersBlockScriptEvent extends BukkitScriptEvent implements Listener {
public class EntityGoesIntoBlockScriptEvent extends BukkitScriptEvent implements Listener {

// <--[event]
// @Events
Expand All @@ -23,21 +23,17 @@ public class EntityEntersBlockScriptEvent extends BukkitScriptEvent implements L
//
// @Cancellable true
//
// @Triggers when an entity enters, and is stored in a block (EG a bee enters a bee nest)
// @Triggers when an entity enters, and is stored in a block (eg a bee enters a bee nest).
// Does not fire when a silverfish "enters" a stone block. Prefer <@link event entity changes block (into block)> for that.
//
// @Context
// <context.entity> returns the EntityTag.
// <context.location> returns the LocationTag of the block entered by the entity.
// <context.material> returns the MaterialTag of the block entered by the entity.
//
// @Player when the entity that entered the block is a player
//
// @NPC when the entity that entered the block is an NPC.
//
// -->

public EntityEntersBlockScriptEvent() {
public EntityGoesIntoBlockScriptEvent() {
registerCouldMatcher("<entity> goes into <block>");
}

Expand All @@ -48,8 +44,7 @@ public EntityEntersBlockScriptEvent() {

@Override
public boolean matches(ScriptPath path) {
String target = path.eventArgLowerAt(0);
if (!entity.tryAdvancedMatcher(target)) {
if (!path.tryArgObject(0, entity)) {
return false;
}
if (!path.tryArgObject(3, material)) {
Expand Down
Expand Up @@ -715,7 +715,8 @@ public static void register() {
// @description
// Returns a copy of the polygon, with the specified corner added to the end of the corner list.
// @example
// # Notes a new polygon with a new corner added. If the new corner has a location of "10,66,-2", and "my_polygon" has corners "0.0,0.0", "7.0,7.0", and "-5.0,6.0",
// # Notes a new polygon with a new corner added.
// # If the new corner has a location of "10,66,-2", and "my_polygon" has corners "0.0,0.0", "7.0,7.0", and "-5.0,6.0",
// # then "my_new_polygon" will have corners "0.0,0.0", "7.0,7.0", "-5.0,6.0", and "10.0,-2.0".
// - note <polygon[my_polygon].with_corner[10,66,-2]> as:my_new_polygon
// -->
Expand Down

0 comments on commit c81a86b

Please sign in to comment.