Skip to content

Commit

Permalink
[1.8.5]修复ItemsAdder物品作为结果时数量错误的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
YufiriaMazenta committed Jan 3, 2024
1 parent 46636dd commit 3960202
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.text.SimpleDateFormat
version = "1.8.5-dev1"
version = "1.8.5"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ public enum ItemsAdderItemProvider implements ItemProvider {
CustomStack customStack = CustomStack.byItemStack(itemStack);
if (customStack == null)
return null;
String id = customStack.getNamespacedID();
if (ignoreAmount) {
return customStack.getNamespacedID();
return id;
} else {
return customStack.getNamespacedID() + " " + (itemStack.getAmount() / customStack.getItemStack().getAmount());
return id + " " + (itemStack.getAmount() / getItem(id).getAmount());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public enum MMOItemsItemProvider implements ItemProvider {
if (ignoreAmount) {
return itemKey;
} else {
ItemStack item = getItem(type + ":" + id);
if (ItemUtil.isAir(item)) {
ItemStack miItem = getItem(itemKey);
if (ItemUtil.isAir(miItem)) {
return null;
}
return itemKey + " " + (itemStack.getAmount() / item.getAmount());
return itemKey + " " + (itemStack.getAmount() / miItem.getAmount());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ public enum NeigeItemsItemProvider implements ItemProvider {
if (niItemInfo == null) {
return null;
}
String id = niItemInfo.getId();
if (ignoreAmount)
return niItemInfo.getId();
return id;
else {
ItemStack niItem = ItemManager.INSTANCE.getItemStack(niItemInfo.getId());
return niItemInfo.getId() + " " + (itemStack.getAmount() / niItem.getAmount());
ItemStack niItem = getItem(id);
return id + " " + (itemStack.getAmount() / niItem.getAmount());
}
}

Expand Down

0 comments on commit 3960202

Please sign in to comment.