mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 04:54:44 +00:00
Merge branch 'refs/heads/dev' into animation-events-2
This commit is contained in:
commit
14bc09c4c8
8 files changed
+243
-18
No files matched your search
@@ -0,0 +1,10 @@
|
||||
package noppes.npcs.api.event;
|
||||
|
||||
public interface ILinkedItemEvent extends IItemEvent {
|
||||
|
||||
// Version Change Event
|
||||
|
||||
// onBreakEvent if Durability Expires or Consumed
|
||||
|
||||
// onRepairEvent
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import noppes.npcs.api.IDamageSource;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IPlayerEffect;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
@@ -268,4 +269,29 @@ public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
|
||||
interface RangedChargeEvent extends IPlayerEvent {
|
||||
}
|
||||
|
||||
interface EffectEvent extends IPlayerEvent {
|
||||
|
||||
IPlayerEffect getEffect();
|
||||
|
||||
interface Added extends EffectEvent {
|
||||
|
||||
}
|
||||
interface Ticked extends EffectEvent {
|
||||
|
||||
}
|
||||
interface Removed extends EffectEvent {
|
||||
|
||||
/**
|
||||
* @return If the effect timer has ticked down to 0.
|
||||
*/
|
||||
boolean hasTimerRunOut();
|
||||
|
||||
/**
|
||||
* @return If the effect was removed on death.
|
||||
*/
|
||||
boolean causedByDeath();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.ICustomEffect;
|
||||
|
||||
public interface ICustomEffectHandler {
|
||||
|
||||
ICustomEffect createEffect(String name);
|
||||
|
||||
ICustomEffect getEffect(String name);
|
||||
|
||||
void deleteEffect(String name);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect -- Only DBC Addon
|
||||
* @return True if Player has Effect
|
||||
*/
|
||||
boolean hasEffect(IPlayer player, int id);
|
||||
|
||||
boolean hasEffect(IPlayer player, ICustomEffect effect);
|
||||
|
||||
/**
|
||||
*
|
||||
* -1 : Does not have effect
|
||||
* -100 : Has infinite effect
|
||||
*
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect -- Only DBC Addon
|
||||
* @return Effect Time
|
||||
*/
|
||||
int getEffectDuration(IPlayer player, int id);
|
||||
|
||||
int getEffectDuration(IPlayer player, ICustomEffect effect);
|
||||
|
||||
/**
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect
|
||||
* @param duration Duration of Effect in Seconds | -100 : Has infinite effect
|
||||
* @param level Level of Effect [Some effects not affected by level]
|
||||
*/
|
||||
void applyEffect(IPlayer player, int id, int duration, byte level);
|
||||
|
||||
void applyEffect(IPlayer player, ICustomEffect effect, int duration, byte level);
|
||||
|
||||
/**
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect
|
||||
*/
|
||||
void removeEffect(IPlayer player, int id);
|
||||
|
||||
void removeEffect(IPlayer player, ICustomEffect effect);
|
||||
|
||||
void clearEffects(IPlayer player);
|
||||
|
||||
ICustomEffect saveEffect(ICustomEffect customEffect);
|
||||
}
|
||||
@@ -1,18 +1,25 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.api.handler.data.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRecipeHandler {
|
||||
List<IRecipe> getGlobalList();
|
||||
|
||||
List<IRecipe> getCarpentryList();
|
||||
|
||||
void addRecipe(String var1, boolean var2, ItemStack var3, Object... var4);
|
||||
|
||||
void addRecipe(String var1, boolean var2, ItemStack var3, int var4, int var5, ItemStack... var6);
|
||||
|
||||
IRecipe delete(int var1);
|
||||
}
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.api.handler.data.IAnvilRecipe;
|
||||
import noppes.npcs.api.handler.data.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRecipeHandler {
|
||||
List<IRecipe> getGlobalList();
|
||||
|
||||
List<IRecipe> getCarpentryList();
|
||||
|
||||
List<IAnvilRecipe> getAnvilList();
|
||||
|
||||
void addRecipe(String var1, boolean var2, ItemStack var3, Object... var4);
|
||||
|
||||
void addRecipe(String var1, boolean var2, ItemStack var3, int var4, int var5, ItemStack... var6);
|
||||
|
||||
IRecipe delete(int var1);
|
||||
|
||||
IAnvilRecipe deleteAnvil(int var1);
|
||||
|
||||
void addAnvilRecipe(String name, boolean global, ItemStack itemToRepair, ItemStack repairMaterial, int xpCost, float repairPercentage);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAnvilRecipe {
|
||||
/**
|
||||
* Returns the unique name of this anvil recipe.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* The XP cost per repair tick (e.g., 10 levels per tick).
|
||||
*/
|
||||
int getXpCost();
|
||||
|
||||
/**
|
||||
* The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).
|
||||
*/
|
||||
float getRepairPercentage();
|
||||
|
||||
/**
|
||||
* Checks whether the provided item and repair material match this recipe.
|
||||
* @param itemToRepair the damaged item
|
||||
* @param repairMaterial the material used to repair
|
||||
* @return true if the items match the recipe requirements
|
||||
*/
|
||||
boolean matches(ItemStack itemToRepair, ItemStack repairMaterial);
|
||||
|
||||
/**
|
||||
* Returns the repaired item based on the input damaged item.
|
||||
* @param itemToRepair the input damaged item
|
||||
* @return a copy with reduced damage
|
||||
*/
|
||||
ItemStack getResult(ItemStack itemToRepair);
|
||||
|
||||
int getID();
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface ICustomEffect {
|
||||
|
||||
int getID();
|
||||
|
||||
String getName();
|
||||
|
||||
void setMenuName(String name);
|
||||
|
||||
String getMenuName();
|
||||
|
||||
void setName(String name);
|
||||
|
||||
String getIcon();
|
||||
|
||||
void setIcon(String icon);
|
||||
|
||||
int getEveryXTick();
|
||||
|
||||
void setEveryXTick(int everyXTick);
|
||||
|
||||
int getIconX();
|
||||
|
||||
void setIconX(int iconX);
|
||||
|
||||
int getIconY();
|
||||
|
||||
void setIconY(int iconY);
|
||||
|
||||
int getWidth();
|
||||
|
||||
void setWidth(int width);
|
||||
|
||||
int getHeight();
|
||||
|
||||
void setHeight(int height);
|
||||
|
||||
boolean isLossOnDeath();
|
||||
|
||||
void setLossOnDeath(boolean lossOnDeath);
|
||||
|
||||
ICustomEffect save();
|
||||
|
||||
void setID(int id);
|
||||
|
||||
/**
|
||||
* Utilized by DBC Addon or other Addons to tell
|
||||
* which map of Effects to Match to.
|
||||
* Index: 0 - CNPC+
|
||||
* Index: 1 - DBC Addon
|
||||
*/
|
||||
int getIndex();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public interface IPlayerEffect {
|
||||
|
||||
void kill();
|
||||
|
||||
int getId();
|
||||
|
||||
int getDuration();
|
||||
|
||||
void setDuration(int duration);
|
||||
|
||||
byte getLevel();
|
||||
|
||||
void setLevel(byte level);
|
||||
|
||||
String getName();
|
||||
|
||||
void performEffect(IPlayer player);
|
||||
|
||||
int getIndex();
|
||||
|
||||
void setIndex(int index);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.api.item;
|
||||
|
||||
public interface IItemLinked extends IItemCustom {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user