1.18 no getTag()
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 24
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
getTag() only exists on 1.17 version.
public static Optional<Integer> getInt(ItemStack item, String key) {
Optional<net.minecraft.world.item.ItemStack> item1;
try {
item1 = getItem(item);
} catch (NoSuchFieldException | IllegalAccessException e) {
return Optional.empty();
}
if (item1.isEmpty()) return Optional.empty();
NBTTagCompound tag = item1.get().getTag(); // exception
if (tag == null) return Optional.empty();
return !tag.contains(key) ? Optional.empty() : Optional.of(tag.getInt(key));
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in 1.18/src/main/java/cat/nyaa/nyaacore/utils/ItemTagUtils.java and compare the shown getInt implementation with the 1.17 version. Inspect the 1.18 ItemStack API to identify the supported tag access used by this path; done means getInt can read the requested integer without the reported getTag() exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100