Compile against 1.15

This commit is contained in:
selfslaughter 2020-03-30 16:28:29 +10:00
parent f91d57434f
commit 1a84072f75
5 changed files with 18 additions and 14 deletions

10
pom.xml
View File

@ -2,13 +2,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.Steffion</groupId>
<artifactId>BlockHunt</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.5.0-SNAPSHOT</version>
<name>BlockHunt</name>
<properties>
<plugin.version>${project.version}-${buildnumber}</plugin.version>
<buildnumber />
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot.api.version>1.13</spigot.api.version>
<spigot.api.version>1.15</spigot.api.version>
<spigot.version>${spigot.api.version}.2-R0.1-SNAPSHOT</spigot.version>
</properties>
<scm>
@ -73,7 +73,7 @@
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>LibsDisguises</artifactId>
<version>9.7.1-SNAPSHOT</version>
<version>9.9.9</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@ -109,7 +109,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
@ -119,7 +119,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<version>2.5.3</version>
</plugin>
</plugins>
</build>

View File

@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
public class OnInventoryClickEvent implements Listener {
@ -31,8 +32,9 @@ public class OnInventoryClickEvent implements Listener {
}
Inventory inv = event.getInventory();
InventoryView invView = event.getView();
if (inv.getType().equals(InventoryType.CHEST)) {
if (inv.getName().contains("DisguiseBlocks")) {
if (invView.getTitle().contains("DisguiseBlocks")) {
if (event.getCurrentItem() != null) {
if (!event.getCurrentItem().getType().isBlock()) {
if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT)) {
@ -46,11 +48,11 @@ public class OnInventoryClickEvent implements Listener {
}
// Early exit if this isnt a blockhunt inventory
if (!inv.getName().contains("BlockHunt"))
if (!invView.getTitle().contains("BlockHunt"))
return;
if (inv.getName().startsWith("\u00A7r")) {
if (inv.getName().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
if (invView.getTitle().startsWith("\u00A7r")) {
if (invView.getTitle().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
event.setCancelled(true);
ItemStack item = event.getCurrentItem();
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
@ -90,7 +92,7 @@ public class OnInventoryClickEvent implements Listener {
}
InventoryHandler.openShop(player);
} else if (inv.getName().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
event.setCancelled(true);
if (event.getCurrentItem().getType() != Material.AIR) {
if (event.getCurrentItem().getType().isBlock()) {
@ -101,7 +103,7 @@ public class OnInventoryClickEvent implements Listener {
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
}
}
} else if (inv.getName().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
event.setCancelled(true);
if (event.getCurrentItem().getType() != Material.AIR) {
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {

View File

@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
public class OnInventoryCloseEvent implements Listener {
@ -21,8 +22,9 @@ public class OnInventoryCloseEvent implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryCloseEvent(InventoryCloseEvent event) {
Inventory inv = event.getInventory();
InventoryView invView = event.getView();
if (inv.getType().equals(InventoryType.CHEST)) {
if (inv.getName().contains("DisguiseBlocks")) {
if (invView.getTitle().contains("DisguiseBlocks")) {
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
Arena arena = null;

View File

@ -63,7 +63,7 @@ public class OnPlayerInteractEvent implements Listener {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (event.getClickedBlock() != null) {
if (event.getClickedBlock().getType().equals(Material.SIGN) || event.getClickedBlock().getType().equals(Material.WALL_SIGN)) {
if (event.getClickedBlock().getState() instanceof Sign) {
if (SignsHandler.isSign(event.getClickedBlock().getLocation())) {
Sign sign = (Sign) event.getClickedBlock().getState();
if (sign.getLine(1) != null) {

View File

@ -92,7 +92,7 @@ public class SignsHandler {
MemoryStorage.signs.load();
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
if (loc.getBlock().getType().equals(Material.SIGN) || loc.getBlock().getType().equals(Material.WALL_SIGN)) {
if (loc.getBlock().getState() instanceof Sign) {
Sign signblock = (Sign) loc.getBlock().getState();
String[] lines = signblock.getLines();
if (sign.contains("leave")) {