From 39a9540f29e49cae9eacdb3a81a2069e75bb94d6 Mon Sep 17 00:00:00 2001 From: BONNe Date: Fri, 3 Jan 2020 15:47:02 +0200 Subject: [PATCH] Downgrade 1.10 release to 1.13.2 version --- pom.xml | 2 +- .../flags/protection/BreakBlocksListener.java | 10 ++----- .../flags/protection/LecternListener.java | 29 ++++++++++--------- .../world/bentobox/bentobox/lists/Flags.java | 12 ++++---- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 74c43be3b..10a529f35 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 1.13.2-R0.1-SNAPSHOT 1.5 1.7 - 2.10.4 + 2.10.3 master-SNAPSHOT d5f5e0bbd8 3.0-SNAPSHOT diff --git a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BreakBlocksListener.java b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BreakBlocksListener.java index 4fe4a3f6f..d0421cf0e 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BreakBlocksListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BreakBlocksListener.java @@ -4,12 +4,8 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; -import org.bukkit.entity.AbstractArrow; -import org.bukkit.entity.ArmorStand; -import org.bukkit.entity.EnderCrystal; -import org.bukkit.entity.ItemFrame; -import org.bukkit.entity.Player; -import org.bukkit.entity.Projectile; +//import org.bukkit.entity.AbstractArrow; +import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; @@ -141,7 +137,7 @@ private boolean notAllowed(EntityDamageByEntityEvent e, Player player, Location @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onProjectileHitBreakBlock(ProjectileHitEvent e) { // We want to make sure this is an actual projectile (arrow or trident) - if (!(e.getEntity() instanceof AbstractArrow)) { + if (!(e.getEntity() instanceof Arrow)) { return; } diff --git a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/LecternListener.java b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/LecternListener.java index ba4ca43a0..486aea78b 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/LecternListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/LecternListener.java @@ -4,7 +4,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockPlaceEvent; -import org.bukkit.event.player.PlayerTakeLecternBookEvent; +//import org.bukkit.event.player.PlayerTakeLecternBookEvent; import world.bentobox.bentobox.api.flags.FlagListener; import world.bentobox.bentobox.lists.Flags; @@ -15,17 +15,18 @@ */ public class LecternListener extends FlagListener { - @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) - public void onPlayerTakeBookFromLectern(PlayerTakeLecternBookEvent e) { - checkIsland(e, e.getPlayer(), e.getLectern().getLocation(), Flags.LECTERN); - } - - @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) - public void onPlaceBooksOnLectern(BlockPlaceEvent e) { - if (e.getItemInHand().getType().equals(Material.WRITABLE_BOOK) - || e.getItemInHand().getType().equals(Material.WRITTEN_BOOK)) { - // Books can only be placed on lecterns and as such are protected by the LECTERN flag. - checkIsland(e, e.getPlayer(), e.getBlock().getLocation(), Flags.LECTERN); - } - } +// Lecterns are not in 1.13 +// @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) +// public void onPlayerTakeBookFromLectern(PlayerTakeLecternBookEvent e) { +// checkIsland(e, e.getPlayer(), e.getLectern().getLocation(), Flags.LECTERN); +// } +// +// @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) +// public void onPlaceBooksOnLectern(BlockPlaceEvent e) { +// if (e.getItemInHand().getType().equals(Material.WRITABLE_BOOK) +// || e.getItemInHand().getType().equals(Material.WRITTEN_BOOK)) { +// // Books can only be placed on lecterns and as such are protected by the LECTERN flag. +// checkIsland(e, e.getPlayer(), e.getBlock().getLocation(), Flags.LECTERN); +// } +// } } diff --git a/src/main/java/world/bentobox/bentobox/lists/Flags.java b/src/main/java/world/bentobox/bentobox/lists/Flags.java index 07dab573f..6dc3cf999 100644 --- a/src/main/java/world/bentobox/bentobox/lists/Flags.java +++ b/src/main/java/world/bentobox/bentobox/lists/Flags.java @@ -118,12 +118,12 @@ private Flags() {} * @see BreakBlocksListener */ public static final Flag DRAGON_EGG = new Flag.Builder("DRAGON_EGG", Material.DRAGON_EGG).build(); - /** - * Prevents players from placing a book on a lectern or taking the book from it. - * @since 1.10.0 - * @see LecternListener - */ - public static final Flag LECTERN = new Flag.Builder("LECTERN", Material.LECTERN).listener(new LecternListener()).build(); +// /** +// * Prevents players from placing a book on a lectern or taking the book from it. +// * @since 1.10.0 +// * @see LecternListener +// */ +// public static final Flag LECTERN = new Flag.Builder("LECTERN", Material.LECTERN).listener(new LecternListener()).build(); // Entity interactions public static final Flag ARMOR_STAND = new Flag.Builder("ARMOR_STAND", Material.ARMOR_STAND).listener(new EntityInteractListener()).mode(Flag.Mode.ADVANCED).build();