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:
parent
6b03850965
commit
dad6020680
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user