diff --git a/build.gradle b/build.gradle index a2adcb6..1073735 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ repositories { url "https://cursemaven.com" } - maven{ + maven { name 'Impactor Economy' url "https://maven.impactdev.net/repository/development/" } diff --git a/src/main/java/unsafedodo/guishop/command/GUIShopAddHeldItemCommand.java b/src/main/java/unsafedodo/guishop/command/GUIShopAddHeldItemCommand.java index 28888ed..886cbb6 100644 --- a/src/main/java/unsafedodo/guishop/command/GUIShopAddHeldItemCommand.java +++ b/src/main/java/unsafedodo/guishop/command/GUIShopAddHeldItemCommand.java @@ -8,6 +8,8 @@ import me.lucko.fabric.api.permissions.v0.Permissions; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.StringNbtReader; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.text.Text; @@ -70,7 +72,15 @@ public static int run(CommandContext context) throws Comman } } - foundShop.getItems().add(new ShopItem(itemName, itemMaterial, buyItemPrice, sellItemPrice, new String[]{}, heldItem.getNbt(), quantities)); + foundShop.getItems().add(new ShopItem( + itemName, + itemMaterial, + buyItemPrice, + sellItemPrice, + new String[]{}, + heldItem.getNbt() != null ? heldItem.getNbt() : StringNbtReader.parse("{}"), + quantities + )); context.getSource().sendFeedback(() -> Text.literal("Item successfully added").formatted(Formatting.GREEN), false); } catch (NumberFormatException nfe) { context.getSource().sendFeedback(() -> Text.literal("Could not add item: Invalid quantities").formatted(Formatting.RED), false); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e902b7a..ed5e60e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -7,6 +7,9 @@ "authors": [ "UnsafeDodo" ], + "contributors": [ + "MrShawn" + ], "contact": { "homepage": "https://fabricmc.net/", "sources": "https://github.com/FabricMC/fabric-example-mod"