Skip to content

Commit

Permalink
fix seed gathering/protection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SchnTgaiSpock committed May 10, 2023
1 parent 2a4763c commit a6c0621
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/food-suggestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ assignees: ''
<!--
Some tips for the recipe:
- Don't focus too much on making it realistic, just the list of ingredients and tools is usually good enough
- On the other hand, don't be afraid to also suggest an intermediate product (like tapioca pearls for the boba tea recipe) or a completely new plant/resource, as long as that new plant/resource is pretty common enough and may possibly be used in more recipes in the future.
- On the other hand, don't be afraid to also suggest an intermediate product (like tapioca pearls for the boba tea recipe) or a completely new plant/resource if it seems appropriate
-->

## Any other comments (optional)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import io.github.schntgaispock.gastronomicon.util.ChunkPDC;
import io.github.schntgaispock.gastronomicon.util.item.GastroKeys;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import me.mrCookieSlime.Slimefun.api.BlockStorage;

public class FermenterRefillListener implements Listener {
Expand All @@ -31,6 +33,9 @@ public void onRefill(PlayerInteractEvent e) {
if (b == null)
return;

if (!Slimefun.getProtectionManager().hasPermission(e.getPlayer(), b, Interaction.INTERACT_BLOCK))
return;

final SlimefunItem sfItem = BlockStorage.check(b);
if (sfItem == null || !(sfItem instanceof final Fermenter fermenter))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import io.github.schntgaispock.gastronomicon.api.loot.LootTable;
import io.github.schntgaispock.gastronomicon.core.Climate;
import io.github.schntgaispock.gastronomicon.util.NumberUtil;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;

public class WildHarvestListener implements Listener {

Expand Down Expand Up @@ -77,6 +79,9 @@ public void onBlockBreak(BlockBreakEvent e) {
if (drops == null)
return;

if (!Slimefun.getProtectionManager().hasPermission(e.getPlayer(), e.getBlock(), Interaction.BREAK_BLOCK))
return;

final ItemStack weapon = e.getPlayer().getInventory().getItemInMainHand();
final int fortune = weapon == null ? 0
: weapon.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS);
Expand Down

0 comments on commit a6c0621

Please sign in to comment.