1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Feature/block drop creative (#3934)

Co-authored-by: J3fftw <44972470+J3fftw1@users.noreply.github.com>
Co-authored-by: Silent <boksic420@gmail.com>
This commit is contained in:
Silent 2023-12-31 09:58:28 +01:00 committed by GitHub
parent 6b03850965
commit dad6020680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -240,7 +241,9 @@ public class BlockListener implements Listener {
for (ItemStack drop : drops) { for (ItemStack drop : drops) {
// Prevent null or air from being dropped // Prevent null or air from being dropped
if (drop != null && drop.getType() != Material.AIR) { if (drop != null && drop.getType() != Material.AIR) {
e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), drop); if (e.getPlayer().getGameMode() != GameMode.CREATIVE || Slimefun.getCfg().getBoolean("options.drop-block-creative")) {
e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), drop);
}
} }
} }
} }

View File

@ -22,6 +22,7 @@ options:
burn-players-when-radioactive: true burn-players-when-radioactive: true
drop-excess-sf-give-items: false drop-excess-sf-give-items: false
backup-data: true backup-data: true
drop-block-creative: true
guide: guide:
show-vanilla-recipes: true show-vanilla-recipes: true