mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-16 07:45:12 +01:00
Added protection for plates and buttons from arrows
Added button text for flag.
This commit is contained in:
parent
3657dda094
commit
66f3b5032d
@ -11,30 +11,9 @@
|
||||
|
||||
banner: "BANNER:1:BLUE:STRIPE_DOWNLEFT:WHITE:STRIPE_DOWNRIGHT:WHITE:STRIPE_CENTER:WHITE:STRIPE_MIDDLE:WHITE:STRAIGHT_CROSS:RED:CROSS:RED"
|
||||
|
||||
not-setup:
|
||||
header: |-
|
||||
More set up is required before the plugin can start...
|
||||
Edit config.yml. Then restart server.
|
||||
distance: "Make sure you set island distance. If upgrading, set it to what it was before."
|
||||
generator: |-
|
||||
The world generator for the island world is not registered.
|
||||
Potential reasons are:
|
||||
1. If you are configuring the island world as the only server world
|
||||
Make sure you have added the world to bukkit.yml
|
||||
2. You reloaded instead of restarting the server. Reboot and try again.
|
||||
generator-multiverse: " 3. Your Multiverse plugin is out of date. Upgrade to the latest version."
|
||||
world-name: |-
|
||||
The world name in config.yml is different to the world name in islands.yml.
|
||||
If this is intentional, we assume you are doing a full reset.
|
||||
If so, delete islands.yml and the previous world.
|
||||
If not, correct the world name in config.yml and restart. This is probably the case if you are upgrading.
|
||||
config-outdated: |-
|
||||
The config.yml file looks outdated.
|
||||
Make sure you updated your configuration after upgrading.
|
||||
If this error is still happening, you probably edited the old config rather than editing the new one.
|
||||
If so, please remove the current config.yml, work on config.new.yml and rename it to config.yml.
|
||||
|
||||
general:
|
||||
success: "Success!"
|
||||
errors:
|
||||
no-permission: "You don't have permission to execute this command."
|
||||
protection:
|
||||
flags:
|
||||
ARMOR_STAND:
|
||||
description: "Toggle interaction"
|
||||
name: "Armour stands"
|
||||
hint: "Armour stand use disabled"
|
||||
|
@ -307,6 +307,10 @@ protection:
|
||||
description: "Toggle interaction"
|
||||
name: Buckets
|
||||
hint: "No bucket use allowed"
|
||||
BUTTON:
|
||||
description: "Toggle button use"
|
||||
name: Buttons
|
||||
hint: "No button use allowed"
|
||||
CHEST:
|
||||
description: "Toggle chest access"
|
||||
name: Chests
|
||||
|
@ -1,11 +1,15 @@
|
||||
package us.tastybento.bskyblock.listeners.flags;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityInteractEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import us.tastybento.bskyblock.api.flags.AbstractFlagListener;
|
||||
import us.tastybento.bskyblock.api.user.User;
|
||||
import us.tastybento.bskyblock.lists.Flags;
|
||||
|
||||
/**
|
||||
@ -20,7 +24,7 @@ public class PhysicalInteractionListener extends AbstractFlagListener {
|
||||
* @param e - event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerInteract(final PlayerInteractEvent e) {
|
||||
public void onPlayerInteract(PlayerInteractEvent e) {
|
||||
if (!e.getAction().equals(Action.PHYSICAL)) {
|
||||
return;
|
||||
}
|
||||
@ -41,4 +45,33 @@ public class PhysicalInteractionListener extends AbstractFlagListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onProjectileHit(EntityInteractEvent e) {
|
||||
if (e.getEntity() == null || !(e.getEntity() instanceof Projectile)) {
|
||||
return;
|
||||
}
|
||||
Projectile p = (Projectile)e.getEntity();
|
||||
if (p.getShooter() != null && p.getShooter() instanceof Player && e.getBlock() != null) {
|
||||
// Set the user to the shooter
|
||||
setUser(User.getInstance((Player)p.getShooter()));
|
||||
|
||||
switch(e.getBlock().getType()) {
|
||||
case WOOD_BUTTON:
|
||||
case STONE_BUTTON:
|
||||
checkIsland(e, e.getBlock().getLocation(), Flags.BUTTON);
|
||||
break;
|
||||
case WOOD_PLATE:
|
||||
case STONE_PLATE:
|
||||
case GOLD_PLATE:
|
||||
case IRON_PLATE:
|
||||
// Pressure plates
|
||||
checkIsland(e, e.getBlock().getLocation(), Flags.PRESSURE_PLATE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user