Skip to content

Commit

Permalink
event grouping improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 10, 2020
1 parent d24dce7 commit f34c0ac
Show file tree
Hide file tree
Showing 130 changed files with 273 additions and 16 deletions.
2 changes: 2 additions & 0 deletions plugin/src/main/java/com/denizenscript/denizen/Denizen.java
Expand Up @@ -3,6 +3,8 @@
import com.denizenscript.denizen.events.ScriptEventRegistry;
import com.denizenscript.denizen.events.bukkit.SavesReloadEvent;
import com.denizenscript.denizen.events.core.*;
import com.denizenscript.denizen.events.server.ServerPrestartScriptEvent;
import com.denizenscript.denizen.events.server.ServerStartScriptEvent;
import com.denizenscript.denizen.flags.FlagManager;
import com.denizenscript.denizen.objects.EntityTag;
import com.denizenscript.denizen.objects.InventoryTag;
Expand Down
Expand Up @@ -2,10 +2,10 @@

import com.denizenscript.denizen.Denizen;
import com.denizenscript.denizen.events.block.*;
import com.denizenscript.denizen.events.core.*;
import com.denizenscript.denizen.events.entity.*;
import com.denizenscript.denizen.events.item.*;
import com.denizenscript.denizen.events.player.*;
import com.denizenscript.denizen.events.server.*;
import com.denizenscript.denizen.events.vehicle.*;
import com.denizenscript.denizen.events.world.*;
import com.denizenscript.denizen.utilities.depends.Depends;
Expand Down Expand Up @@ -40,12 +40,6 @@ public static void registerMainEvents() {
ScriptEvent.registerScriptEvent(new PistonRetractsScriptEvent());
ScriptEvent.registerScriptEvent(new RedstoneScriptEvent());

// Core events
ScriptEvent.registerScriptEvent(new ListPingScriptEvent());
ScriptEvent.registerScriptEvent(new ServerPrestartScriptEvent());
ScriptEvent.registerScriptEvent(new ServerStartScriptEvent());
ScriptEvent.registerScriptEvent(new TabCompleteScriptEvent());

// Entity events
ScriptEvent.registerScriptEvent(new CreeperPoweredScriptEvent());
ScriptEvent.registerScriptEvent(new DragonPhaseChangeScriptEvent());
Expand Down Expand Up @@ -185,6 +179,13 @@ public static void registerMainEvents() {
ScriptEvent.registerScriptEvent(new PlayerWalksOverScriptEvent());
ScriptEvent.registerScriptEvent(new ResourcePackStatusScriptEvent());

// Server events
ScriptEvent.registerScriptEvent(new CommandScriptEvent());
ScriptEvent.registerScriptEvent(new ListPingScriptEvent());
ScriptEvent.registerScriptEvent(new ServerPrestartScriptEvent());
ScriptEvent.registerScriptEvent(new ServerStartScriptEvent());
ScriptEvent.registerScriptEvent(new TabCompleteScriptEvent());

// Vehicle
ScriptEvent.registerScriptEvent(new VehicleCollidesBlockScriptEvent());
ScriptEvent.registerScriptEvent(new VehicleCollidesEntityScriptEvent());
Expand All @@ -196,7 +197,6 @@ public static void registerMainEvents() {
// World events
ScriptEvent.registerScriptEvent(new ChunkLoadScriptEvent());
ScriptEvent.registerScriptEvent(new ChunkUnloadScriptEvent());
ScriptEvent.registerScriptEvent(new CommandScriptEvent());
ScriptEvent.registerScriptEvent(new LightningStrikesScriptEvent());
ScriptEvent.registerScriptEvent(new LingeringPotionSplashScriptEvent());
ScriptEvent.registerScriptEvent(new LootGenerateScriptEvent());
Expand Down
Expand Up @@ -17,6 +17,8 @@ public class LeafDecaysScriptEvent extends BukkitScriptEvent implements Listener
//
// @Regex ^on [^\s]+ decay$
//
// @Group Block
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -17,6 +17,8 @@ public class NoteBlockPlaysNoteScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on noteblock plays note$
//
// @Group Block
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch instrument:<instrument> to only process the event if a specific instrument was played.
//
Expand Down
Expand Up @@ -17,6 +17,8 @@ public class CreeperPoweredScriptEvent extends BukkitScriptEvent implements List
//
// @Regex ^on creeper powered( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -20,6 +20,8 @@ public class DragonPhaseChangeScriptEvent extends BukkitScriptEvent implements L
//
// @Regex ^on [^\s]+ changes phase$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch from:<phase> to only process the event if the dragon was previously in the specified phase.
// @Switch to:<phase> to only process the event if the dragon is changing to the specified phase.
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityAirLevelChangeScriptEvent extends BukkitScriptEvent implement
//
// @Regex ^on [^\s]+ changes air level$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -27,6 +27,8 @@ public class EntityBreaksHangingScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ breaks [^\s]+( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -23,6 +23,8 @@ public class EntityBreedScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on [^\s]+ breeds$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -24,6 +24,8 @@ public class EntityChangesBlockScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ changes [^\s]+( into [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -24,6 +24,8 @@ public class EntityCombustsScriptEvent extends BukkitScriptEvent implements List
//
// @Regex ^on [^\s]+ combusts$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -22,6 +22,8 @@ public class EntityCreatePortalScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ creates portal$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -38,6 +38,8 @@ public class EntityDamagedScriptEvent extends BukkitScriptEvent implements Liste
//
// @Regex ^on [^\s]+ ((damages [^\s]+)|damaged( by [^\s]+)?)$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Switch with:<item> to only process the event when the item used to cause damage (in the damager's hand) is a specified item.
Expand Down
Expand Up @@ -33,6 +33,8 @@ public class EntityDeathScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on [^\s]+ (death|dies)$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch by:<entity type> to only process the event if the killer is of a specified entity type.
// @Switch cause:<cause> to only process the event if it was caused by a specific damage cause.
Expand Down
Expand Up @@ -17,6 +17,8 @@ public class EntityDespawnScriptEvent extends BukkitScriptEvent {
//
// @Regex ^on [^\s]+ despawns$
//
// @Group Entity
//
// @Warning this event fires very rapidly.
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityEntersPortalScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ enters portal$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Triggers when an entity enters a portal.
Expand Down
Expand Up @@ -23,6 +23,8 @@ public class EntityEntersVehicleScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ enters [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityExitsPortalScriptEvent extends BukkitScriptEvent implements L
//
// @Regex ^on [^\s]+ exits portal$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Triggers when an entity exits a portal.
Expand Down
Expand Up @@ -20,6 +20,8 @@ public class EntityExitsVehicleScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ exits [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -24,6 +24,8 @@ public class EntityExplodesScriptEvent extends BukkitScriptEvent implements List
//
// @Regex ^on [^\s]+ explodes$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityExplosionPrimesScriptEvent extends BukkitScriptEvent implemen
//
// @Regex ^on [^\s]+ explosion primes$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityFoodLevelChangeScriptEvent extends BukkitScriptEvent implemen
//
// @Regex ^on [^\s]+ changes food level$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -22,6 +22,8 @@ public class EntityFormsBlockScriptEvent extends BukkitScriptEvent implements Li
//
// @Regex ^on [^\s]+ forms [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -20,6 +20,8 @@ public class EntityGlideScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on player (toggles|starts|stops) gliding$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -20,6 +20,8 @@ public class EntityHealsScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on [^\s]+ heals( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -22,6 +22,8 @@ public class EntityInteractScriptEvent extends BukkitScriptEvent implements List
//
// @Regex ^on [^\s]+ interacts with [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -34,6 +34,8 @@ public class EntityKilledScriptEvent extends BukkitScriptEvent implements Listen
//
// @Regex ^on [^\s]+ ((kills [^\s]+)|killed( by [^\s]+)?)$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -23,6 +23,8 @@ public class EntityPotionEffectScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on [^\s]+ potion effects [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch cause:<cause> to only process the event when it came from a specified cause.
// @Switch effect:<effect type> to only process the event when a specified potion effect is applied.
Expand Down
Expand Up @@ -18,6 +18,8 @@ public class EntityResurrectScriptEvent extends BukkitScriptEvent implements Lis
//
// @Regex ^on [^\s]+ resurrected$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -31,6 +31,8 @@ public class EntityShootsBowEvent extends BukkitScriptEvent implements Listener
//
// @Regex ^on [^\s]+ shoots [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -23,6 +23,8 @@ public class EntitySpawnScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on [^\s]+ spawns( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -20,6 +20,8 @@ public class EntitySpawnerSpawnScriptEvent extends BukkitScriptEvent implements
//
// @Regex ^on spawner spawns [^\s]+$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -18,7 +18,10 @@ public class EntitySwimScriptEvent extends BukkitScriptEvent implements Listener
// entity starts swimming
// entity stops swimming
//
// @Regex ^on player (toggles|starts|stops) swimming
// @Regex ^on player (toggles|starts|stops) swimming$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -21,6 +21,8 @@ public class EntityTamesScriptEvent extends BukkitScriptEvent implements Listene
//
// @Regex ^on [^\s]+ (tames [^\s]+|tamed)$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -21,6 +21,8 @@ public class EntityTargetsScriptEvent extends BukkitScriptEvent implements Liste
//
// @Regex ^on [^\s]+ targets( [^\s]+)?( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down
Expand Up @@ -23,6 +23,8 @@ public class EntityTeleportScriptEvent extends BukkitScriptEvent implements List
//
// @Regex ^on [^\s]+ teleports$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch cause:<cause> to only process the event when it came from a specified cause.
//
Expand Down
Expand Up @@ -19,6 +19,8 @@ public class EntityTransformScriptEvent extends BukkitScriptEvent implements Lis
//
// @Regex ^on [^\s]+ transforms( into [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
// @Switch because:<reason> to only process the event if a specific reason caused the transformation.
//
Expand Down
Expand Up @@ -18,6 +18,8 @@ public class EntityUnleashedScriptEvent extends BukkitScriptEvent implements Lis
//
// @Regex ^on [^\s]+ unleashed( because [^\s]+)?$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Triggers when an entity is unleashed.
Expand Down
Expand Up @@ -17,6 +17,8 @@ public class ExperienceBottleBreaksScriptEvent extends BukkitScriptEvent impleme
//
// @Regex ^on experience bottle breaks$
//
// @Group Entity
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
Expand Down

0 comments on commit f34c0ac

Please sign in to comment.