From c503aacd7378c6e3710e91c37a16f29d23b787d7 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 18 Nov 2018 11:36:02 -0700 Subject: [PATCH] Remove polymorphic events --- .../runelite/api/events/ActorDespawned.java | 56 ------------------- .../net/runelite/api/events/ActorSpawned.java | 50 ----------------- .../net/runelite/api/events/NpcDespawned.java | 3 +- .../net/runelite/api/events/NpcSpawned.java | 3 +- .../runelite/api/events/PlayerDespawned.java | 3 +- .../runelite/api/events/PlayerSpawned.java | 3 +- .../net/runelite/api/queries/ActorQuery.java | 2 - 7 files changed, 4 insertions(+), 116 deletions(-) delete mode 100644 runelite-api/src/main/java/net/runelite/api/events/ActorDespawned.java delete mode 100644 runelite-api/src/main/java/net/runelite/api/events/ActorSpawned.java diff --git a/runelite-api/src/main/java/net/runelite/api/events/ActorDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/ActorDespawned.java deleted file mode 100644 index 20af3e82db..0000000000 --- a/runelite-api/src/main/java/net/runelite/api/events/ActorDespawned.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api.events; - -import net.runelite.api.Actor; - -/** - * Represents the base event where an {@link Actor} has despawned. - *

- * To hook into a more focused actor type, see the {@link PlayerDespawned} - * or {@link NpcDespawned} events. - *

- * Examples of when this event may trigger include: - *

- *

- * During a world change, the event is only called for Players, - * ie. {@link PlayerDespawned} will trigger but {@link NpcDespawned} - * will not. - *

- * The client logging out does not trigger this event. - */ -public interface ActorDespawned -{ - /** - * Gets the despawned player or NPC. - * - * @return despawned entity - */ - Actor getActor(); -} diff --git a/runelite-api/src/main/java/net/runelite/api/events/ActorSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/ActorSpawned.java deleted file mode 100644 index 1856dfebdb..0000000000 --- a/runelite-api/src/main/java/net/runelite/api/events/ActorSpawned.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api.events; - -import net.runelite.api.Actor; - -/** - * Represents the base event where an {@link Actor} has spawned. - *

- * To hook into a more focused actor type, see the {@link PlayerSpawned} - * or {@link NpcSpawned} events. - *

- * Examples of when this event may trigger include: - *

- */ -public interface ActorSpawned -{ - /** - * Gets the spawned player or NPC. - * - * @return spawned entity - */ - Actor getActor(); -} diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java index c2b7ac9878..0f6399fa4a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java @@ -32,14 +32,13 @@ import net.runelite.api.NPC; * An event where an {@link NPC} has despawned. */ @Value -public class NpcDespawned implements ActorDespawned +public class NpcDespawned { /** * The despawned NPC. */ private final NPC npc; - @Override public Actor getActor() { return npc; diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java index 30ea6cf148..2101bdd4fb 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java @@ -32,14 +32,13 @@ import net.runelite.api.NPC; * An event where an {@link NPC} has spawned. */ @Value -public class NpcSpawned implements ActorSpawned +public class NpcSpawned { /** * The spawned NPC. */ private final NPC npc; - @Override public Actor getActor() { return npc; diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java index 8692d07d97..9e38311069 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java @@ -34,14 +34,13 @@ import net.runelite.api.Player; * Note: This event does not get called for the local player. */ @Value -public class PlayerDespawned implements ActorDespawned +public class PlayerDespawned { /** * The despawned player. */ private final Player player; - @Override public Actor getActor() { return player; diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java index f4372ee818..f730a0b652 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java @@ -32,14 +32,13 @@ import net.runelite.api.Player; * An event where a {@link Player} has spawned. */ @Value -public class PlayerSpawned implements ActorSpawned +public class PlayerSpawned { /** * The spawned player. */ private final Player player; - @Override public Actor getActor() { return player; diff --git a/runelite-api/src/main/java/net/runelite/api/queries/ActorQuery.java b/runelite-api/src/main/java/net/runelite/api/queries/ActorQuery.java index f9b2971179..f6b74c25b7 100644 --- a/runelite-api/src/main/java/net/runelite/api/queries/ActorQuery.java +++ b/runelite-api/src/main/java/net/runelite/api/queries/ActorQuery.java @@ -32,8 +32,6 @@ import net.runelite.api.coords.LocalPoint; /** * Used for getting players in view,deprecated as of existence of Actor spawn events * - * @see net.runelite.api.events.ActorSpawned - * @see net.runelite.api.events.ActorDespawned */ @Deprecated public abstract class ActorQuery extends Query