openrune: NPCDefinition -> NPCComposition
This commit is contained in:
@@ -941,7 +941,7 @@ public interface Client extends GameShell
|
||||
* @return the corresponding NPC composition
|
||||
* @see NpcID
|
||||
*/
|
||||
NPCDefinition getNpcDefinition(int npcId);
|
||||
NPCComposition getNpcDefinition(int npcId);
|
||||
|
||||
/**
|
||||
* Gets an array of all world areas
|
||||
|
||||
@@ -59,7 +59,7 @@ public interface NPC extends Actor
|
||||
*
|
||||
* @return the composition
|
||||
*/
|
||||
NPCDefinition getDefinition();
|
||||
NPCComposition getDefinition();
|
||||
|
||||
/**
|
||||
* Get the composition for this NPC and transform it if required
|
||||
@@ -67,7 +67,7 @@ public interface NPC extends Actor
|
||||
* @return the transformed NPC
|
||||
*/
|
||||
@Nullable
|
||||
NPCDefinition getTransformedDefinition();
|
||||
NPCComposition getTransformedDefinition();
|
||||
|
||||
void onDefinitionChanged(NPCDefinition composition);
|
||||
void onDefinitionChanged(NPCComposition composition);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.api;
|
||||
/**
|
||||
* Information about a specific {@link NpcID}
|
||||
*/
|
||||
public interface NPCDefinition
|
||||
public interface NPCComposition
|
||||
{
|
||||
/**
|
||||
* Gets the name of the NPC.
|
||||
@@ -87,7 +87,7 @@ public interface NPCDefinition
|
||||
*
|
||||
* @throws NullPointerException if {@link #getConfigs()} is null
|
||||
*/
|
||||
NPCDefinition transform();
|
||||
NPCComposition transform();
|
||||
|
||||
/**
|
||||
* How many tiles wide this NPC is
|
||||
@@ -25,10 +25,10 @@
|
||||
package net.runelite.api.events;
|
||||
|
||||
import lombok.Data;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.NPCComposition;
|
||||
|
||||
/**
|
||||
* An event where an action of an {@link NPCDefinition} has changed.
|
||||
* An event where an action of an {@link NPCComposition} has changed.
|
||||
*/
|
||||
@Data
|
||||
public class NpcActionChanged implements Event
|
||||
@@ -36,7 +36,7 @@ public class NpcActionChanged implements Event
|
||||
/**
|
||||
* The NPC composition that has been changed.
|
||||
*/
|
||||
private NPCDefinition npcDefinition;
|
||||
private NPCComposition npcComposition;
|
||||
/**
|
||||
* The raw index of the modified action.
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.mixins;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Hitsplat;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
@@ -229,7 +229,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
int size = 1;
|
||||
if (this instanceof NPC)
|
||||
{
|
||||
NPCDefinition composition = ((NPC)this).getDefinition();
|
||||
NPCComposition composition = ((NPC)this).getDefinition();
|
||||
if (composition != null && composition.getConfigs() != null)
|
||||
{
|
||||
composition = composition.transform();
|
||||
|
||||
@@ -64,7 +64,7 @@ import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NameableContainer;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
@@ -1942,7 +1942,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public NPCDefinition getNpcDefinition(int id)
|
||||
public NPCComposition getNpcDefinition(int id)
|
||||
{
|
||||
assert this.isClientThread() : "getNpcDefinition must be called on client thread";
|
||||
return getRSNpcDefinition(id);
|
||||
|
||||
@@ -11,10 +11,10 @@ import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSNPCDefinition;
|
||||
import net.runelite.rs.api.RSNPCComposition;
|
||||
|
||||
@Mixin(RSNPCDefinition.class)
|
||||
public abstract class RSNPCDefinitionMixin implements RSNPCDefinition
|
||||
@Mixin(RSNPCComposition.class)
|
||||
public abstract class RSNPCCompositionMixin implements RSNPCComposition
|
||||
{
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
@@ -43,7 +43,7 @@ public abstract class RSNPCDefinitionMixin implements RSNPCDefinition
|
||||
public void actionsHook(int idx)
|
||||
{
|
||||
NpcActionChanged npcActionChanged = new NpcActionChanged();
|
||||
npcActionChanged.setNpcDefinition(this);
|
||||
npcActionChanged.setNpcComposition(this);
|
||||
npcActionChanged.setIdx(idx);
|
||||
client.getCallbacks().post(NpcActionChanged.class, npcActionChanged);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ package net.runelite.mixins;
|
||||
|
||||
import java.awt.Shape;
|
||||
import net.runelite.api.AnimationID;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.NpcDefinitionChanged;
|
||||
@@ -40,7 +40,7 @@ import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSModel;
|
||||
import net.runelite.rs.api.RSNPC;
|
||||
import net.runelite.rs.api.RSNPCDefinition;
|
||||
import net.runelite.rs.api.RSNPCComposition;
|
||||
|
||||
@Mixin(RSNPC.class)
|
||||
public abstract class RSNPCMixin implements RSNPC
|
||||
@@ -55,7 +55,7 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
@Override
|
||||
public int getId()
|
||||
{
|
||||
RSNPCDefinition composition = getDefinition();
|
||||
RSNPCComposition composition = getDefinition();
|
||||
if (composition != null && composition.getConfigs() != null)
|
||||
{
|
||||
composition = composition.transform();
|
||||
@@ -67,7 +67,7 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
RSNPCDefinition composition = getDefinition();
|
||||
RSNPCComposition composition = getDefinition();
|
||||
if (composition != null && composition.getConfigs() != null)
|
||||
{
|
||||
composition = composition.transform();
|
||||
@@ -79,7 +79,7 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
@Override
|
||||
public int getCombatLevel()
|
||||
{
|
||||
RSNPCDefinition composition = getDefinition();
|
||||
RSNPCComposition composition = getDefinition();
|
||||
if (composition != null && composition.getConfigs() != null)
|
||||
{
|
||||
composition = composition.transform();
|
||||
@@ -103,7 +103,7 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
|
||||
@FieldHook(value = "definition", before = true)
|
||||
@Inject
|
||||
public void onDefinitionChanged(RSNPCDefinition composition)
|
||||
public void onDefinitionChanged(RSNPCComposition composition)
|
||||
{
|
||||
if (composition == null)
|
||||
{
|
||||
@@ -148,9 +148,9 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public NPCDefinition getTransformedDefinition()
|
||||
public NPCComposition getTransformedDefinition()
|
||||
{
|
||||
RSNPCDefinition composition = getDefinition();
|
||||
RSNPCComposition composition = getDefinition();
|
||||
if (composition != null && composition.getConfigs() != null)
|
||||
{
|
||||
composition = composition.transform();
|
||||
|
||||
@@ -341,7 +341,7 @@ public interface RSClient extends RSGameShell, Client
|
||||
RSObjectDefinition getRSObjectDefinition(int objectId);
|
||||
|
||||
@Import("getNpcDefinition")
|
||||
RSNPCDefinition getRSNpcDefinition(int npcId);
|
||||
RSNPCComposition getRSNpcDefinition(int npcId);
|
||||
|
||||
@Import("viewportZoom")
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,7 @@ public interface RSNPC extends RSActor, NPC
|
||||
{
|
||||
@Import("definition")
|
||||
@Override
|
||||
RSNPCDefinition getDefinition();
|
||||
RSNPCComposition getDefinition();
|
||||
|
||||
@Override
|
||||
int getIndex();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.runelite.rs.api;
|
||||
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.mapping.Import;
|
||||
|
||||
public interface RSNPCDefinition extends NPCDefinition
|
||||
public interface RSNPCComposition extends NPCComposition
|
||||
{
|
||||
@Import("name")
|
||||
@Override
|
||||
@@ -51,7 +51,7 @@ public interface RSNPCDefinition extends NPCDefinition
|
||||
|
||||
@Import("transform")
|
||||
@Override
|
||||
RSNPCDefinition transform();
|
||||
RSNPCComposition transform();
|
||||
|
||||
@Import("size")
|
||||
@Override
|
||||
Reference in New Issue
Block a user