Skip to content

Commit

Permalink
fix missing determine for clicks-in-inventory event
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 24, 2020
1 parent a5e0916 commit 18fb805
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ public boolean matches(ScriptPath path) {
return super.matches(path);
}

@Override
public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
if (!isDefaultDetermination(determinationObj) && ItemTag.matches(determinationObj.toString())) {
event.setCurrentItem(ItemTag.valueOf(determinationObj.toString()).getItemStack());
return true;
}
return super.applyDetermination(path, determinationObj);
}

@Override
public String getName() {
return "PlayerClicksInInventory";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ else if (foodLevel / maxHunger < 1) {
// @returns ElementTag(Number)
// @mechanism PlayerTag.food_level
// @description
// Returns the current food level of the player.
// Returns the current food level (aka hunger) of the player.
// -->
registerOnlineOnlyTag("food_level", (attribute, object) -> {
if (attribute.startsWith("formatted", 2)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public File getScriptFolder() {
File file = null;
// Get the script directory
if (Settings.useDefaultScriptPath()) {
file = new File(DenizenAPI.getCurrentInstance()
.getDataFolder() + File.separator + "scripts");
file = new File(DenizenAPI.getCurrentInstance().getDataFolder() + File.separator + "scripts");
}
else {
file = new File(Settings.getAlternateScriptPath().replace("/", File.separator));
Expand Down

0 comments on commit 18fb805

Please sign in to comment.