Initial 1.14 support

This commit is contained in:
DJ Muted 2019-05-06 13:59:24 +02:00
parent 7b982c2687
commit 15513b96fd
7 changed files with 14 additions and 13 deletions

View File

@ -107,7 +107,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.13-R0.1-SNAPSHOT</version> <version>1.14-R0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>

View File

@ -327,7 +327,7 @@ public class Team {
this.getTeamConfig().resolveInt( this.getTeamConfig().resolveInt(
TeamConfig.LIFEPOOL)).split("\n"); TeamConfig.LIFEPOOL)).split("\n");
} }
signBlock.setType(Material.SIGN); signBlock.setType(Material.OAK_SIGN);
org.bukkit.block.Sign block = (org.bukkit.block.Sign) signBlock org.bukkit.block.Sign block = (org.bukkit.block.Sign) signBlock
.getState(); .getState();
org.bukkit.material.Sign data = (Sign) block.getData(); org.bukkit.material.Sign data = (Sign) block.getData();

View File

@ -334,7 +334,7 @@ public class WarPlayerListener implements Listener {
latestLocations.put(player.getName(), playerLoc); latestLocations.put(player.getName(), playerLoc);
// Signs can automatically teleport you to specific or random warzones // Signs can automatically teleport you to specific or random warzones
if (playerLoc.getBlock().getType() == Material.SIGN) { if (playerLoc.getBlock().getType() == Material.OAK_SIGN) {
Sign sign = (Sign) playerLoc.getBlock().getState(); Sign sign = (Sign) playerLoc.getBlock().getState();
if (sign.getLine(0).equals("[zone]")) { if (sign.getLine(0).equals("[zone]")) {
Warzone indicated = Warzone.getZoneByName(sign.getLine(1)); Warzone indicated = Warzone.getZoneByName(sign.getLine(1));

View File

@ -213,7 +213,7 @@ public class WarHub {
} }
// War hub sign // War hub sign
locationBlock.getRelative(front, 2).setType(Material.SIGN); locationBlock.getRelative(front, 2).setType(Material.OAK_SIGN);
String[] lines = War.war.getString("sign.warhub").split("\n"); String[] lines = War.war.getString("sign.warhub").split("\n");
org.bukkit.block.Sign locationBlockFront = (org.bukkit.block.Sign) locationBlock.getRelative(front, 2).getState(); org.bukkit.block.Sign locationBlockFront = (org.bukkit.block.Sign) locationBlock.getRelative(front, 2).getState();
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -256,7 +256,7 @@ public class WarHub {
Block zoneGate = this.zoneGateBlocks.get(zone.getName()); Block zoneGate = this.zoneGateBlocks.get(zone.getName());
if (zoneGate != null) { if (zoneGate != null) {
zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).setType(Material.WALL_SIGN); zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).setType(Material.OAK_WALL_SIGN);
org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).getState(); org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).getState();
org.bukkit.material.Sign data = (Sign) block.getData(); org.bukkit.material.Sign data = (Sign) block.getData();
data.setFacingDirection(this.getOrientation().getOppositeFace()); data.setFacingDirection(this.getOrientation().getOppositeFace());

View File

@ -368,7 +368,7 @@ public class ZoneLobby {
// set zone sign // set zone sign
Block zoneSignBlock = this.lobbyMiddleWallBlock.getBlock().getRelative(this.wall, 4); Block zoneSignBlock = this.lobbyMiddleWallBlock.getBlock().getRelative(this.wall, 4);
zoneSignBlock.setType(Material.SIGN); zoneSignBlock.setType(Material.OAK_SIGN);
org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneSignBlock.getState(); org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneSignBlock.getState();
org.bukkit.material.Sign data = (Sign) block.getData(); org.bukkit.material.Sign data = (Sign) block.getData();
data.setFacingDirection(this.wall); data.setFacingDirection(this.wall);
@ -768,11 +768,12 @@ public class ZoneLobby {
block = gate.getRelative(direction).getRelative(BlockFace.UP, 2); block = gate.getRelative(direction).getRelative(BlockFace.UP, 2);
} }
block.setType(Material.WALL_SIGN); block.setType(Material.OAK_WALL_SIGN);
org.bukkit.block.Sign state = (org.bukkit.block.Sign) block.getState(); org.bukkit.block.Sign state = (org.bukkit.block.Sign) block.getState();
org.bukkit.material.Sign data = (Sign) state.getData(); org.bukkit.block.data.type.WallSign data = (org.bukkit.block.data.type.WallSign) block.getBlockData();
data.setFacingDirection(direction); data.setFacing(direction);
state.setData(data);
state.setBlockData(data);
for (int i = 0; i < lines.length; i++) { for (int i = 0; i < lines.length; i++) {
state.setLine(i, lines[i]); state.setLine(i, lines[i]);
} }

View File

@ -32,8 +32,8 @@ public class ZoneWallGuard {
Material.TALL_GRASS, Material.TALL_GRASS,
Material.VINE, Material.VINE,
Material.LILY_PAD, Material.LILY_PAD,
Material.DANDELION_YELLOW, Material.YELLOW_DYE,
Material.ROSE_RED, Material.RED_DYE,
Material.RED_MUSHROOM, Material.RED_MUSHROOM,
Material.BROWN_MUSHROOM, Material.BROWN_MUSHROOM,
Material.DEAD_BUSH, Material.DEAD_BUSH,

View File

@ -58,7 +58,7 @@ public class UIManager implements Listener {
if (uiMap.containsKey(player)) { if (uiMap.containsKey(player)) {
ChestUI ui = uiMap.get(player); ChestUI ui = uiMap.get(player);
if (inventory.getName().equals(ui.getTitle())) { if (event.getView().getTitle().equals(ui.getTitle())) {
if (ui.processClick(clicked, inventory)) { if (ui.processClick(clicked, inventory)) {
event.setCancelled(true); event.setCancelled(true);
player.closeInventory(); player.closeInventory();