diff --git a/build.gradle b/build.gradle index 7b6b699b..5e6e7a47 100644 --- a/build.gradle +++ b/build.gradle @@ -321,8 +321,6 @@ task curseforge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) { onlyIf { !project.ext.changelog.isEmpty() } } -tasks.modrinth.dependsOn(tasks.generateChangelog) -tasks.modrinth.onlyIf { !project.ext.changelog.isEmpty() } modrinth { token = System.getenv("MODRINTH_TOKEN") projectId = "${modrinth_project_id}" @@ -336,7 +334,13 @@ modrinth { optional.project "crafting-tweaks" optional.project "curios" } - changelog = "${ project.ext.changelog }" + changelog = provider { + project.ext.changelog + } +} +tasks.modrinth { + dependsOn(tasks.generateChangelog) + onlyIf { !project.ext.changelog.isEmpty() } } task printVersionName { diff --git a/gradle.properties b/gradle.properties index e86cd5f3..79f284e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.daemon=false mod_id=sophisticatedbackpacks mod_group_id=sophisticatedbackpacks -mod_version=3.20.7 +mod_version=3.20.8 sonar_project_key=sophisticatedbackpacks:SophisticatedBackpacks github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/toolswapper/ToolSwapperUpgradeWrapper.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/toolswapper/ToolSwapperUpgradeWrapper.java index 861e0eb5..48fb98dd 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/toolswapper/ToolSwapperUpgradeWrapper.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/toolswapper/ToolSwapperUpgradeWrapper.java @@ -254,13 +254,15 @@ private boolean swapWeapon(Player player, ItemStack mainHandItem, IItemHandlerSi return true; } - InventoryHelper.extractFromInventory(sword, backpackInventory, false); + ItemStack swordCopy = sword.copy(); + swordCopy.setCount(1); + InventoryHelper.extractFromInventory(swordCopy, backpackInventory, false); if (backpackInventory.insertItem(mainHandItem, true).isEmpty()) { - player.setItemInHand(InteractionHand.MAIN_HAND, sword); + player.setItemInHand(InteractionHand.MAIN_HAND, swordCopy); backpackInventory.insertItem(mainHandItem, false); return true; } else { - backpackInventory.insertItem(sword, false); + backpackInventory.insertItem(swordCopy, false); return false; } }