Skip to content

Commit

Permalink
fix wrong itemstack constructor in computer helper
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Nov 14, 2023
1 parent e01e5df commit f04adf7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ public ItemStack getItemStack(int param) throws ComputerException {
Item item = getItemFromResourceLocation(ResourceLocation.tryParse((String) map.get("name")));
int count = SpecialConverters.getIntFromRaw(map.get("count"));
String nbt = (String) map.get("nbt");
return new ItemStack(item, count, nbt != null ? NbtUtils.snbtToStructure(nbt) : null);
ItemStack stack = new ItemStack(item, count);
if (nbt != null) {
stack.setTag(NbtUtils.snbtToStructure(nbt));
}
return stack;
} catch (ClassCastException ex) {
throw new ComputerException("Invalid ItemStack at index "+param);
} catch (CommandSyntaxException e) {
Expand Down

0 comments on commit f04adf7

Please sign in to comment.