1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-11-22 18:46:33 +01:00

Switch to 1.13 API

This commit is contained in:
tastybento 2018-07-26 22:42:47 -07:00
parent 6dd7d0f762
commit b780d68064
3 changed files with 25 additions and 25 deletions

View File

@ -45,7 +45,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -46,7 +46,7 @@ public class WarpSignsListener implements Listener {
public void onSignBreak(BlockBreakEvent e) {
Block b = e.getBlock();
// Signs only
if (!b.getType().equals(Material.SIGN_POST) && !b.getType().equals(Material.WALL_SIGN)) {
if (!b.getType().equals(Material.SIGN) && !b.getType().equals(Material.WALL_SIGN)) {
return;
}
if (!addon.inRegisteredWorld(b.getWorld())) {
@ -90,7 +90,7 @@ public class WarpSignsListener implements Listener {
public void onSignWarpCreate(SignChangeEvent e) {
Block b = e.getBlock();
// Signs only
if (!b.getType().equals(Material.SIGN_POST) && !b.getType().equals(Material.WALL_SIGN)) {
if (!b.getType().equals(Material.SIGN) && !b.getType().equals(Material.WALL_SIGN)) {
return;
}
if (!addon.inRegisteredWorld(b.getWorld())) {
@ -148,7 +148,7 @@ public class WarpSignsListener implements Listener {
// so,
// deactivate it
Block oldSignBlock = oldSignLoc.getBlock();
if (oldSignBlock.getType().equals(Material.SIGN_POST) || oldSignBlock.getType().equals(Material.WALL_SIGN)) {
if (oldSignBlock.getType().equals(Material.SIGN) || oldSignBlock.getType().equals(Material.WALL_SIGN)) {
// The block is still a sign
Sign oldSign = (Sign) oldSignBlock.getState();
if (oldSign != null) {

View File

@ -185,7 +185,7 @@ public class WarpSignsManager {
// Load into map
if (warps != null) {
warps.getWarpSigns().forEach((k,v) -> {
if (k != null && (k.getBlock().getType().equals(Material.SIGN_POST) || k.getBlock().getType().equals(Material.WALL_SIGN))) {
if (k != null && (k.getBlock().getType().equals(Material.SIGN) || k.getBlock().getType().equals(Material.WALL_SIGN))) {
// Add to map
getWarpList(k.getWorld()).put(v, k);
}
@ -199,7 +199,7 @@ public class WarpSignsManager {
*/
private void popSign(Location loc) {
Block b = loc.getBlock();
if (b.getType().equals(Material.SIGN_POST) || b.getType().equals(Material.WALL_SIGN)) {
if (b.getType().equals(Material.SIGN) || b.getType().equals(Material.WALL_SIGN)) {
Sign s = (Sign) b.getState();
if (s != null) {
if (s.getLine(0).equalsIgnoreCase(ChatColor.GREEN + addon.getConfig().getString("welcomeLine"))) {
@ -273,7 +273,7 @@ public class WarpSignsManager {
if (DEBUG2)
Bukkit.getLogger().info("DEBUG: getting sign text");
// Get the sign info if it exists
if (signLocation.getBlock().getType().equals(Material.SIGN_POST) || signLocation.getBlock().getType().equals(Material.WALL_SIGN)) {
if (signLocation.getBlock().getType().equals(Material.SIGN) || signLocation.getBlock().getType().equals(Material.WALL_SIGN)) {
if (DEBUG2)
Bukkit.getLogger().info("DEBUG: sign is a sign");
Sign sign = (Sign)signLocation.getBlock().getState();
@ -394,7 +394,7 @@ public class WarpSignsManager {
}
// Find out which direction the warp is facing
Block b = warpSpot.getBlock();
if (b.getType().equals(Material.SIGN_POST) || b.getType().equals(Material.WALL_SIGN)) {
if (b.getType().equals(Material.SIGN) || b.getType().equals(Material.WALL_SIGN)) {
Sign sign = (Sign) b.getState();
org.bukkit.material.Sign s = (org.bukkit.material.Sign) sign.getData();
BlockFace directionFacing = s.getFacing();
@ -417,7 +417,7 @@ public class WarpSignsManager {
if (!(plugin.getIslands().isSafeLocation(warpSpot))) {
user.sendMessage("warps.error.NotSafe");
// WALL_SIGN's will always be unsafe if the place in front is obscured.
if (b.getType().equals(Material.SIGN_POST)) {
if (b.getType().equals(Material.SIGN)) {
addon.getLogger().warning(
"Unsafe warp found at " + warpSpot.toString() + " owned by " + addon.getBSkyBlock().getPlayers().getName(owner));