mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
parent
72738f42b9
commit
23af6e7012
@ -6,13 +6,15 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import world.bentobox.bentobox.api.flags.FlagListener;
|
||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.lists.Flags;
|
||||
|
||||
public class CoarseDirtTillingListener extends FlagListener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onTillingCoarseDirt(PlayerInteractEvent e) {
|
||||
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getItem() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -26,7 +28,9 @@ public class CoarseDirtTillingListener extends FlagListener {
|
||||
if (e.getClickedBlock().getType().equals(Material.COARSE_DIRT)
|
||||
&& getIWM().inWorld(e.getClickedBlock().getWorld())
|
||||
&& !Flags.COARSE_DIRT_TILLING.isSetForWorld(e.getClickedBlock().getWorld())) {
|
||||
noGo(e, Flags.COARSE_DIRT_TILLING);
|
||||
e.setCancelled(true);
|
||||
User user = User.getInstance(e.getPlayer());
|
||||
user.notify("protection.protected", TextVariables.DESCRIPTION, user.getTranslation(Flags.COARSE_DIRT_TILLING.getHintReference()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -442,9 +442,9 @@ protection:
|
||||
name: "Clean Super Flat"
|
||||
COARSE_DIRT_TILLING:
|
||||
description: |-
|
||||
&aPrevent the players from
|
||||
&atilling the coarse dirt
|
||||
&ato obtain dirt
|
||||
&aToggle tilling the
|
||||
&acoarse dirt to
|
||||
&aobtain dirt
|
||||
name: "Coarse dirt tilling"
|
||||
hint: "No coarse dirt tilling"
|
||||
COLLECT_LAVA:
|
||||
|
Loading…
Reference in New Issue
Block a user