Skip to content

Commit

Permalink
Fix #2676, add the missing slot.allowsModification() check, apply t…
Browse files Browse the repository at this point in the history
…o molds, vessels, and fishing rods
  • Loading branch information
alcatrazEscapee committed Jun 13, 2024
1 parent 110cc00 commit cc02746
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ dependencies {
//runtimeOnly(fg.deobf("curse.maven:panoramica-426082:4019292"))
//runtimeOnly(fg.deobf("curse.maven:embeddium-908741:4819807"))
//runtimeOnly(fg.deobf("curse.maven:rubidium-574856:4767529"))
//runtimeOnly(fg.deobf("curse.maven:create-328085:4835191"))
//runtimeOnly(fg.deobf("curse.maven:corpse-316582:5157034"))

// JUnit
// There is not a testImplementation-like configuration, AFAIK, that is available at minecraft runtime, so we use minecraftLibrary
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/dries007/tfc/common/items/MoldItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ else if (!mold.getFluidInTank(0).isEmpty())
@Override
public boolean overrideOtherStackedOnMe(ItemStack stack, ItemStack carried, Slot slot, ClickAction action, Player player, SlotAccess carriedSlot)
{
if (action == ClickAction.SECONDARY && !player.isCreative())
if (action == ClickAction.SECONDARY && !player.isCreative() && slot.allowModification(player))
{
final MoldLike mold = MoldLike.get(stack);
if (mold != null && !mold.isMolten())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level level, List<Compone
public boolean overrideOtherStackedOnMe(ItemStack stack, ItemStack carried, Slot slot, ClickAction action, Player player, SlotAccess carriedSlot)
{
final BaitType type = getBaitType(carried);
if (type != BaitType.NONE && !player.isCreative() && action == ClickAction.SECONDARY)
if (type != BaitType.NONE && !player.isCreative() && action == ClickAction.SECONDARY && slot.allowModification(player))
{
if (type == BaitType.SMALL && Helpers.isItem(stack, TFCTags.Items.HOLDS_SMALL_FISHING_BAIT))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean overrideStackedOnOther(ItemStack stack, Slot slot, ClickAction ac
public boolean overrideOtherStackedOnMe(ItemStack stack, ItemStack carried, Slot slot, ClickAction action, Player player, SlotAccess carriedSlot)
{
final VesselLike vessel = getInventoryVessel(stack);
if (vessel != null && TFCConfig.SERVER.enableSmallVesselInventoryInteraction.get() && !player.isCreative() && action == ClickAction.SECONDARY)
if (vessel != null && TFCConfig.SERVER.enableSmallVesselInventoryInteraction.get() && !player.isCreative() && action == ClickAction.SECONDARY && slot.allowModification(player))
{
if (!carried.isEmpty())
{
Expand Down

0 comments on commit cc02746

Please sign in to comment.