Compile against 1.15
This commit is contained in:
parent
f91d57434f
commit
1a84072f75
10
pom.xml
10
pom.xml
@ -2,13 +2,13 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>nl.Steffion</groupId>
|
<groupId>nl.Steffion</groupId>
|
||||||
<artifactId>BlockHunt</artifactId>
|
<artifactId>BlockHunt</artifactId>
|
||||||
<version>0.4.0-SNAPSHOT</version>
|
<version>0.5.0-SNAPSHOT</version>
|
||||||
<name>BlockHunt</name>
|
<name>BlockHunt</name>
|
||||||
<properties>
|
<properties>
|
||||||
<plugin.version>${project.version}-${buildnumber}</plugin.version>
|
<plugin.version>${project.version}-${buildnumber}</plugin.version>
|
||||||
<buildnumber />
|
<buildnumber />
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<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>
|
<spigot.version>${spigot.api.version}.2-R0.1-SNAPSHOT</spigot.version>
|
||||||
</properties>
|
</properties>
|
||||||
<scm>
|
<scm>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>LibsDisguises</groupId>
|
<groupId>LibsDisguises</groupId>
|
||||||
<artifactId>LibsDisguises</artifactId>
|
<artifactId>LibsDisguises</artifactId>
|
||||||
<version>9.7.1-SNAPSHOT</version>
|
<version>9.9.9</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@ -109,7 +109,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
@ -119,7 +119,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.3</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class OnInventoryClickEvent implements Listener {
|
public class OnInventoryClickEvent implements Listener {
|
||||||
@ -31,8 +32,9 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Inventory inv = event.getInventory();
|
Inventory inv = event.getInventory();
|
||||||
|
InventoryView invView = event.getView();
|
||||||
if (inv.getType().equals(InventoryType.CHEST)) {
|
if (inv.getType().equals(InventoryType.CHEST)) {
|
||||||
if (inv.getName().contains("DisguiseBlocks")) {
|
if (invView.getTitle().contains("DisguiseBlocks")) {
|
||||||
if (event.getCurrentItem() != null) {
|
if (event.getCurrentItem() != null) {
|
||||||
if (!event.getCurrentItem().getType().isBlock()) {
|
if (!event.getCurrentItem().getType().isBlock()) {
|
||||||
if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT)) {
|
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
|
// Early exit if this isnt a blockhunt inventory
|
||||||
if (!inv.getName().contains("BlockHunt"))
|
if (!invView.getTitle().contains("BlockHunt"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inv.getName().startsWith("\u00A7r")) {
|
if (invView.getTitle().startsWith("\u00A7r")) {
|
||||||
if (inv.getName().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
|
if (invView.getTitle().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
ItemStack item = event.getCurrentItem();
|
ItemStack item = event.getCurrentItem();
|
||||||
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
||||||
@ -90,7 +92,7 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
InventoryHandler.openShop(player);
|
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);
|
event.setCancelled(true);
|
||||||
if (event.getCurrentItem().getType() != Material.AIR) {
|
if (event.getCurrentItem().getType() != Material.AIR) {
|
||||||
if (event.getCurrentItem().getType().isBlock()) {
|
if (event.getCurrentItem().getType().isBlock()) {
|
||||||
@ -101,7 +103,7 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
|
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);
|
event.setCancelled(true);
|
||||||
if (event.getCurrentItem().getType() != Material.AIR) {
|
if (event.getCurrentItem().getType() != Material.AIR) {
|
||||||
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {
|
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class OnInventoryCloseEvent implements Listener {
|
public class OnInventoryCloseEvent implements Listener {
|
||||||
@ -21,8 +22,9 @@ public class OnInventoryCloseEvent implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onInventoryCloseEvent(InventoryCloseEvent event) {
|
public void onInventoryCloseEvent(InventoryCloseEvent event) {
|
||||||
Inventory inv = event.getInventory();
|
Inventory inv = event.getInventory();
|
||||||
|
InventoryView invView = event.getView();
|
||||||
if (inv.getType().equals(InventoryType.CHEST)) {
|
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"), "");
|
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
|
||||||
|
|
||||||
Arena arena = null;
|
Arena arena = null;
|
||||||
|
@ -63,7 +63,7 @@ public class OnPlayerInteractEvent implements Listener {
|
|||||||
|
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
if (event.getClickedBlock() != null) {
|
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())) {
|
if (SignsHandler.isSign(event.getClickedBlock().getLocation())) {
|
||||||
Sign sign = (Sign) event.getClickedBlock().getState();
|
Sign sign = (Sign) event.getClickedBlock().getState();
|
||||||
if (sign.getLine(1) != null) {
|
if (sign.getLine(1) != null) {
|
||||||
|
@ -92,7 +92,7 @@ public class SignsHandler {
|
|||||||
MemoryStorage.signs.load();
|
MemoryStorage.signs.load();
|
||||||
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
|
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
|
||||||
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
|
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();
|
Sign signblock = (Sign) loc.getBlock().getState();
|
||||||
String[] lines = signblock.getLines();
|
String[] lines = signblock.getLines();
|
||||||
if (sign.contains("leave")) {
|
if (sign.contains("leave")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user