openrune: ItemDefinition -> ItemComposition

This commit is contained in:
therealunull
2020-12-13 12:47:59 -05:00
parent 81577a4271
commit 528e9dd5e7
8 changed files with 16 additions and 16 deletions

View File

@@ -386,7 +386,7 @@ public interface Client extends GameShell
* @see ItemID * @see ItemID
*/ */
@Nonnull @Nonnull
ItemDefinition getItemDefinition(int id); ItemComposition getItemDefinition(int id);
/** /**
* Creates an item icon sprite with passed variables. * Creates an item icon sprite with passed variables.

View File

@@ -101,7 +101,7 @@ public class Constants
/** /**
* High alchemy = shop price * HIGH_ALCHEMY_MULTIPLIER * High alchemy = shop price * HIGH_ALCHEMY_MULTIPLIER
* *
* @see ItemDefinition#getPrice * @see ItemComposition#getPrice
*/ */
public static final float HIGH_ALCHEMY_MULTIPLIER = 0.6f; public static final float HIGH_ALCHEMY_MULTIPLIER = 0.6f;

View File

@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
/** /**
* Represents the template of a specific item type. * Represents the template of a specific item type.
*/ */
public interface ItemDefinition public interface ItemComposition
{ {
/** /**
* Gets the items name. * Gets the items name.

View File

@@ -25,10 +25,10 @@
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data; import lombok.Data;
import net.runelite.api.ItemDefinition; import net.runelite.api.ItemComposition;
/** /**
* An event called after a new {@link ItemDefinition} is created and * An event called after a new {@link ItemComposition} is created and
* its data is initialized. * its data is initialized.
*/ */
@Data @Data
@@ -37,5 +37,5 @@ public class PostItemDefinition implements Event
/** /**
* The newly created item. * The newly created item.
*/ */
private ItemDefinition itemDefinition; private ItemComposition itemComposition;
} }

View File

@@ -51,7 +51,7 @@ import net.runelite.api.IndexDataBase;
import net.runelite.api.IndexedSprite; import net.runelite.api.IndexedSprite;
import net.runelite.api.IntegerNode; import net.runelite.api.IntegerNode;
import net.runelite.api.InventoryID; import net.runelite.api.InventoryID;
import net.runelite.api.ItemDefinition; import net.runelite.api.ItemComposition;
import net.runelite.api.MenuEntry; import net.runelite.api.MenuEntry;
import net.runelite.api.MenuAction; import net.runelite.api.MenuAction;
import static net.runelite.api.MenuAction.PLAYER_EIGTH_OPTION; import static net.runelite.api.MenuAction.PLAYER_EIGTH_OPTION;
@@ -1934,7 +1934,7 @@ public abstract class RSClientMixin implements RSClient
@Inject @Inject
@Override @Override
@Nonnull @Nonnull
public ItemDefinition getItemDefinition(int id) public ItemComposition getItemDefinition(int id)
{ {
assert this.isClientThread() : "getItemDefinition must be called on client thread"; assert this.isClientThread() : "getItemDefinition must be called on client thread";
return getRSItemDefinition(id); return getRSItemDefinition(id);

View File

@@ -8,11 +8,11 @@ import net.runelite.api.mixins.Mixin;
import net.runelite.api.mixins.Replace; import net.runelite.api.mixins.Replace;
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.RSItemDefinition; import net.runelite.rs.api.RSItemComposition;
import net.runelite.rs.api.RSModel; import net.runelite.rs.api.RSModel;
@Mixin(RSItemDefinition.class) @Mixin(RSItemComposition.class)
public abstract class RSItemDefinitionMixin implements RSItemDefinition public abstract class RSItemCompositionMixin implements RSItemComposition
{ {
private static final int DEFAULT_CUSTOM_SHIFT_CLICK_INDEX = -2; private static final int DEFAULT_CUSTOM_SHIFT_CLICK_INDEX = -2;
@@ -33,7 +33,7 @@ public abstract class RSItemDefinitionMixin implements RSItemDefinition
} }
@Inject @Inject
RSItemDefinitionMixin() RSItemCompositionMixin()
{ {
} }
@@ -70,7 +70,7 @@ public abstract class RSItemDefinitionMixin implements RSItemDefinition
public void post() public void post()
{ {
final PostItemDefinition event = new PostItemDefinition(); final PostItemDefinition event = new PostItemDefinition();
event.setItemDefinition(this); event.setItemComposition(this);
client.getCallbacks().post(PostItemDefinition.class, event); client.getCallbacks().post(PostItemDefinition.class, event);
} }

View File

@@ -402,7 +402,7 @@ public interface RSClient extends RSGameShell, Client
RSNodeHashTable getItemContainers(); RSNodeHashTable getItemContainers();
@Import("ItemDefinition_get") @Import("ItemDefinition_get")
RSItemDefinition getRSItemDefinition(int itemId); RSItemComposition getRSItemDefinition(int itemId);
@Import("getItemSprite") @Import("getItemSprite")
RSSpritePixels createRSItemSprite(int itemId, int quantity, int thickness, int borderColor, int stackable, boolean noted); RSSpritePixels createRSItemSprite(int itemId, int quantity, int thickness, int borderColor, int stackable, boolean noted);

View File

@@ -1,9 +1,9 @@
package net.runelite.rs.api; package net.runelite.rs.api;
import net.runelite.api.ItemDefinition; import net.runelite.api.ItemComposition;
import net.runelite.mapping.Import; import net.runelite.mapping.Import;
public interface RSItemDefinition extends ItemDefinition public interface RSItemComposition extends ItemComposition
{ {
@Import("name") @Import("name")
@Override @Override