mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 18:49:39 +00:00
feat: allow scripts to modify anvil cost
This commit is contained in:
1 parent
2cd06193c2
commit
e73e785fbf
2 files changed
+35
-6
No files matched your search
@@ -36,6 +36,8 @@ public class RecipeScriptEvent extends PlayerEvent {
|
||||
@Cancelable
|
||||
public static class Pre extends RecipeScriptEvent {
|
||||
private String message = "";
|
||||
private int xpCost = 0;
|
||||
private int materialUsage = 0;
|
||||
|
||||
public Pre(IPlayer player, Object recipe, boolean isAnvil, IItemStack[] items) {
|
||||
super(player, recipe, isAnvil, items);
|
||||
@@ -49,6 +51,24 @@ public class RecipeScriptEvent extends PlayerEvent {
|
||||
return message;
|
||||
}
|
||||
|
||||
public int getXpCost() {
|
||||
return xpCost;
|
||||
}
|
||||
|
||||
public void setXpCost(int xpCost) {
|
||||
if (this.isAnvil)
|
||||
this.xpCost = xpCost;
|
||||
}
|
||||
|
||||
public int getMaterialUsage() {
|
||||
return materialUsage;
|
||||
}
|
||||
|
||||
public void setMaterialUsage(int materialUsage) {
|
||||
if (this.isAnvil)
|
||||
this.materialUsage = materialUsage;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return RecipeScript.ScriptType.PRE.function;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user