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