Skip to content

Commit e9d365f

Browse files
committed
修复bug
1 parent e64af46 commit e9d365f

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ show_testing_output = false
1515

1616
# Mod Information
1717
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
18-
mod_version = 1.2.1
18+
mod_version = 1.2.2
1919
root_package = com.circulation
2020
mod_id = only_one_item
2121
mod_name = OnlyOneItem

src/main/java/com/circulation/only_one_item/handler/MatchItemHandler.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,19 @@ public class MatchItemHandler {
5050
public static void preItemStackInit() {
5151
odToTargetMap.forEach((od,i) -> {
5252
var ods = OreDictionary.getOres(od);
53+
var listC = new ObjectArrayList<>(ods);
5354
ods.clear();
55+
for (ItemStack stack : listC) {
56+
Item item = stack.getItem();
57+
ResourceLocation rl = item.getRegistryName();
58+
int meta = stack.getMetadata();
59+
if (rl == null) continue;
60+
if ((finalItemBlackMap.containsKey(rl) && finalItemBlackMap.get(rl).contains(meta))
61+
|| finalMODIDBlackSet.contains(rl.getNamespace())
62+
|| allTarget.contains(SimpleItem.getInstance(stack))) {
63+
ods.add(stack);
64+
}
65+
}
5466
ods.add(i.getItemStack());
5567
});
5668

0 commit comments

Comments
 (0)