Skip to content

Commit

Permalink
Merge pull request #1155 from P3pp3rF1y/1.20.x-dev
Browse files Browse the repository at this point in the history
Release merge
  • Loading branch information
P3pp3rF1y authored Sep 24, 2024
2 parents bc582b3 + 35c19ce commit 9eb31f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 9eb31f6

Please sign in to comment.