From 6e496fed5d2933d3d61726fc1bd1f0b9f7a78b24 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 27 Mar 2024 04:27:46 -0400 Subject: [PATCH 1/6] Add Scripted Item Documentation + IsNormalItem Rendering Type --- java/noppes/npcs/api/item/IItemCustom.java | 197 ++++++++++++++++++++- 1 file changed, 190 insertions(+), 7 deletions(-) diff --git a/java/noppes/npcs/api/item/IItemCustom.java b/java/noppes/npcs/api/item/IItemCustom.java index ced2538..3c2febc 100644 --- a/java/noppes/npcs/api/item/IItemCustom.java +++ b/java/noppes/npcs/api/item/IItemCustom.java @@ -2,85 +2,268 @@ package noppes.npcs.api.item; public interface IItemCustom extends IItemStack { + /** + * @return true if scripted item script is enabled + */ boolean getEnabled(); - void setEnabled(boolean bo); + /** + * @param enable Enable or Disable scripted item script + */ + void setEnabled(boolean enable); + /** + * Gets the texture path for the scripted item. + * @return The texture path + */ String getTexture(); - void setTexture(String var2); + /** + * Sets the texture path for the scripted item. Can be a URL + * @param texture The texture path + */ + void setTexture(String texture); + /** + * Sets the armor type for the scripted item. + * @param armorType The armor type + */ void setArmorType(int armorType); + /** + * Gets the armor type for the scripted item. + * @return The armor type + */ int getArmorType(); + /** + * Sets whether the scripted item is a tool. + * @param isTool True if the item is a tool, false otherwise + */ void setIsTool(boolean isTool); + /** + * Checks if the scripted item is a tool. Allows for enchanting + * @return True if the item is a tool, false otherwise + */ boolean isTool(); + /** + * Sets whether the scripted item is a normal item. Will disable + * all forms of Rotation, Translation, Scale Rendering in hand and on ground + * @param normalItem True if the item is a normal item, false otherwise + */ + void setIsNormalItem(boolean normalItem); + + /** + * Checks if the scripted item is a normal item. + * @return True if the item is a normal item, false otherwise + */ + boolean isNormalItem(); + + /** + * Sets the dig speed for the scripted item. + * @param digSpeed The dig speed + */ void setDigSpeed(int digSpeed); + /** + * Gets the dig speed for the scripted item. + * @return The dig speed + */ int getDigSpeed(); - void setMaxStackSize(int var1); + /** + * Sets the maximum stack size for the scripted item. + * @param maxStackSize The maximum stack size + */ + void setMaxStackSize(int maxStackSize); + /** + * Gets the current durability value for the scripted item. + * @return The durability value + */ double getDurabilityValue(); - void setDurabilityValue(float var1); + /** + * Sets the current durability value for the scripted item. + * @param durabilityValue The durability value + */ + void setDurabilityValue(float durabilityValue); + /** + * Checks if the durability bar should be shown for the scripted item. + * @return True if the durability bar should be shown, false otherwise + */ boolean getDurabilityShow(); - void setDurabilityShow(boolean var1); + /** + * Sets whether the durability bar should be shown for the scripted item. + * @param durabilityShow True if the durability bar should be shown, false otherwise + */ + void setDurabilityShow(boolean durabilityShow); + /** + * Gets the color of the durability bar for the scripted item. + * @return The durability bar color + */ int getDurabilityColor(); - void setDurabilityColor(int var1); + /** + * Sets the color of the durability bar for the scripted item. + * @param durabilityColor The durability bar color + */ + void setDurabilityColor(int durabilityColor); + /** + * Gets the color of the scripted item. + * @return The item color + */ int getColor(); - void setColor(int var1); + /** + * Sets the color of the scripted item. + * @param color The item color + */ + void setColor(int color); + /** + * Gets the maximum item use duration for the scripted item. + * @return The maximum item use duration + */ int getMaxItemUseDuration(); + /** + * Sets the maximum item use duration for the scripted item. + * @param duration The maximum item use duration + */ void setMaxItemUseDuration(int duration); + /** + * Sets the item use action for the scripted item. + * @param action The item use action + */ void setItemUseAction(int action); + /** + * Gets the item use action for the scripted item. + * @return The item use action + */ int getItemUseAction(); + /** + * Gets the enchantability for the scripted item. + * @return The enchantability + */ int getEnchantability(); + /** + * Sets the enchantability for the scripted item. + * @param enchantability The enchantability + */ void setEnchantability(int enchantability); + /** + * Sets the rotation values for the scripted item. + * @param rotationX The X-axis rotation + * @param rotationY The Y-axis rotation + * @param rotationZ The Z-axis rotation + */ void setRotation(float rotationX, float rotationY, float rotationZ); + /** + * Sets the rotation rate values for the scripted item. Spinning Speed + * @param rotationXRate The X-axis rotation rate + * @param rotationYRate The Y-axis rotation rate + * @param rotationZRate The Z-axis rotation rate + */ void setRotationRate(float rotationXRate, float rotationYRate, float rotationZRate); + /** + * Sets the scale values for the scripted item. + * @param scaleX The X-axis scale + * @param scaleY The Y-axis scale + * @param scaleZ The Z-axis scale + */ void setScale(float scaleX, float scaleY, float scaleZ); + /** + * Sets the translation values for the scripted item. + * @param translateX The X-axis translation + * @param translateY The Y-axis translation + * @param translateZ The Z-axis translation + */ void setTranslate(float translateX, float translateY, float translateZ); + /** + * Gets the X-axis rotation for the scripted item. + * @return The X-axis rotation + */ float getRotationX(); + /** + * Gets the Y-axis rotation for the scripted item. + * @return The Y-axis rotation + */ float getRotationY(); + /** + * Gets the Z-axis rotation for the scripted item. + * @return The Z-axis rotation + */ float getRotationZ(); + /** + * Gets the X-axis rotation rate for the scripted item. + * @return The X-axis rotation rate + */ float getRotationXRate(); + /** + * Gets the Y-axis rotation rate for the scripted item. + * @return The Y-axis rotation rate + */ float getRotationYRate(); + /** + * Gets the Z-axis rotation rate for the scripted item. + * @return The Z-axis rotation rate + */ float getRotationZRate(); + /** + * Gets the X-axis scale for the scripted item. + * @return The X-axis scale + */ float getScaleX(); + /** + * Gets the Y-axis scale for the scripted item. + * @return The Y-axis scale + */ float getScaleY(); + /** + * Gets the Z-axis scale for the scripted item. + * @return The Z-axis scale + */ float getScaleZ(); + /** + * Gets the X-axis translation for the scripted item. + * @return The X-axis translation + */ float getTranslateX(); + /** + * Gets the Y-axis translation for the scripted item. + * @return The Y-axis translation + */ float getTranslateY(); + /** + * Gets the Z-axis translation for the scripted item. + * @return The Z-axis translation + */ float getTranslateZ(); } From 6fc9c2f6e8b0024dc7d98abf0663887138938bf0 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 28 Mar 2024 01:16:20 -0400 Subject: [PATCH 2/6] Compare Items --- java/noppes/npcs/api/item/IItemStack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/noppes/npcs/api/item/IItemStack.java b/java/noppes/npcs/api/item/IItemStack.java index 2d1c966..50a6c7d 100644 --- a/java/noppes/npcs/api/item/IItemStack.java +++ b/java/noppes/npcs/api/item/IItemStack.java @@ -136,4 +136,8 @@ public interface IItemStack { NBTTagCompound getMCNbt(); void setMCNbt(NBTTagCompound compound); + + public boolean compare(IItemStack item, boolean ignoreNBT); + + boolean compare(IItemStack item, boolean ignoreDamage, boolean ignoreNBT); } From a78358b2218f35efe134234b54c211ee5afa10ca Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 28 Mar 2024 01:33:03 -0400 Subject: [PATCH 3/6] ICloneHandler Has --- java/noppes/npcs/api/handler/ICloneHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/noppes/npcs/api/handler/ICloneHandler.java b/java/noppes/npcs/api/handler/ICloneHandler.java index 7dbfe79..6d8f8c2 100644 --- a/java/noppes/npcs/api/handler/ICloneHandler.java +++ b/java/noppes/npcs/api/handler/ICloneHandler.java @@ -16,6 +16,8 @@ public interface ICloneHandler { IEntity get(int tab, String name, IWorld world); + boolean has(int tab, String name); + void set(int tab, String name, IEntity entity); void remove(int tab, String name); From a9d904024f0ac32e8645492f7324cef9959eac08 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 28 Mar 2024 01:33:14 -0400 Subject: [PATCH 4/6] Copy and GetMaxItemDamage for Script Items --- java/noppes/npcs/api/item/IItemStack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/noppes/npcs/api/item/IItemStack.java b/java/noppes/npcs/api/item/IItemStack.java index 50a6c7d..84991cc 100644 --- a/java/noppes/npcs/api/item/IItemStack.java +++ b/java/noppes/npcs/api/item/IItemStack.java @@ -92,6 +92,10 @@ public interface IItemStack { boolean hasAttribute(String name); + IItemStack copy(); + + int getMaxItemDamage(); + /** * @since 1.7.10d * @return Returns whether this item is a book From 34d7c504964517ed8236dc24310dca62af8bd92e Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 28 Mar 2024 01:33:23 -0400 Subject: [PATCH 5/6] Broadcast to all players in a world --- java/noppes/npcs/api/IWorld.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index 0f5a7e7..cfc55ca 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -436,4 +436,6 @@ public interface IWorld { * @return The ID of this world's dimension. 0 for overworld, 1 for End, -1 for Nether, etc. */ int getDimensionID(); + + void broadcast(String message); } From 2fc048b93e0f58ea59a4c7f943b7b46a98d42ee9 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 29 Mar 2024 01:34:56 -0400 Subject: [PATCH 6/6] Update INpcEvent.java --- java/noppes/npcs/api/event/INpcEvent.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index 44ee4d4..d6bfa85 100644 --- a/java/noppes/npcs/api/event/INpcEvent.java +++ b/java/noppes/npcs/api/event/INpcEvent.java @@ -58,6 +58,11 @@ public interface INpcEvent extends ICustomNPCsEvent { } interface SwingEvent extends INpcEvent { + + /** + * Can be null + * @return Returns the swung item + */ IItemStack getItemStack(); }