mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
Make close check for bag/box more robust
This commit is contained in:
1 parent
9493ca8548
commit
3fdea4c605
2 files changed
+6
-4
No files matched your search
@@ -66,8 +66,9 @@ public class ContainerFlowerBag extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(@Nonnull PlayerEntity player) {
|
||||
return player.getHeldItemMainhand() == bag
|
||||
|| player.getHeldItemOffhand() == bag;
|
||||
ItemStack main = player.getHeldItemMainhand();
|
||||
ItemStack off = player.getHeldItemOffhand();
|
||||
return !main.isEmpty() && main == bag || !off.isEmpty() && off == bag;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -78,8 +78,9 @@ public class ContainerBaubleBox extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(@Nonnull PlayerEntity player) {
|
||||
return player.getHeldItemMainhand() == box
|
||||
|| player.getHeldItemOffhand() == box;
|
||||
ItemStack main = player.getHeldItemMainhand();
|
||||
ItemStack off = player.getHeldItemOffhand();
|
||||
return !main.isEmpty() && main == box || !off.isEmpty() && off == box;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
Reference in new issue
Block a user