Fix a lot of errors in updating to 1.13

This commit is contained in:
= 2018-10-31 17:10:51 -07:00
parent 47be664a93
commit 0babe82368
No known key found for this signature in database
GPG Key ID: 918580825B8F6862
19 changed files with 63 additions and 63 deletions

View File

@ -121,7 +121,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<version>1.13-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.kitteh</groupId>

View File

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

View File

@ -83,7 +83,7 @@ public class War extends JavaPlugin {
private Economy econ = null;
private SpoutDisplayer spoutMessenger = null;
private HubLobbyMaterials warhubMaterials = new HubLobbyMaterials(
new ItemStack(Material.GLASS), new ItemStack(Material.WOOD),
new ItemStack(Material.GLASS), new ItemStack(Material.OAK_WOOD),
new ItemStack(Material.OBSIDIAN), new ItemStack(Material.GLOWSTONE));
private UIManager UIManager;
@ -239,7 +239,7 @@ public class War extends JavaPlugin {
stonePick.setDurability((short) 8);
defaultLoadout.put(3, stonePick);
ItemStack stoneSpade = new ItemStack(Material.STONE_SPADE, 1, (byte) 8);
ItemStack stoneSpade = new ItemStack(Material.STONE_SHOVEL, 1, (byte) 8);
stoneSword.setDurability((short) 8);
defaultLoadout.put(4, stoneSpade);
@ -1127,7 +1127,7 @@ public class War extends JavaPlugin {
public void addWandBearer(Player player, String zoneName) {
if (this.wandBearers.containsKey(player.getName())) {
String alreadyHaveWand = this.wandBearers.get(player.getName());
if (player.getInventory().first(Material.WOOD_SWORD) != -1) {
if (player.getInventory().first(Material.WOODEN_SWORD) != -1) {
if (zoneName.equals(alreadyHaveWand)) {
this.badMsg(player, "You already have a wand for zone " + alreadyHaveWand + ". Drop the wooden sword first.");
} else {
@ -1140,7 +1140,7 @@ public class War extends JavaPlugin {
// lost his sword, or new warzone
if (zoneName.equals(alreadyHaveWand)) {
// same zone, give him a new sword
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD, 1, (byte) 8));
player.getInventory().addItem(new ItemStack(Material.WOODEN_SWORD, 1, (byte) 8));
this.msg(player, "Here's a new sword for zone " + zoneName + ".");
}
}
@ -1149,7 +1149,7 @@ public class War extends JavaPlugin {
this.badMsg(player, "Your inventory is full. Please drop an item and try again.");
} else {
this.wandBearers.put(player.getName(), zoneName);
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD, 1, (byte) 8));
player.getInventory().addItem(new ItemStack(Material.WOODEN_SWORD, 1, (byte) 8));
// player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.WOOD_SWORD));
this.msg(player, "You now have a wand for zone " + zoneName + ". Left-click with wooden sword for corner 1. Right-click for corner 2.");
War.war.log(player.getName() + " now has a wand for warzone " + zoneName, Level.INFO);

View File

@ -103,7 +103,7 @@ public class Warzone {
private HubLobbyMaterials lobbyMaterials = null;
private WarzoneMaterials warzoneMaterials = new WarzoneMaterials(
new ItemStack(Material.OBSIDIAN), new ItemStack(Material.FENCE),
new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OAK_FENCE),
new ItemStack(Material.GLOWSTONE));
private boolean isEndOfGame = false;

View File

@ -45,7 +45,7 @@ public class KillstreakReward {
section.set("5.reward.airstrike", true);
section.set("5.reward.items", ImmutableList.of(new ItemStack(Material.ARROW, 15), new ItemStack(Material.EGG)));
section.set("5.reward.effect", Effect.GHAST_SHRIEK.name());
ItemStack sword = new ItemStack(Material.WOOD_SWORD);
ItemStack sword = new ItemStack(Material.WOODEN_SWORD);
sword.addEnchantment(Enchantment.DAMAGE_ALL, 2);
sword.addEnchantment(Enchantment.KNOCKBACK, 1);
ItemMeta meta = sword.getItemMeta();

View File

@ -11,22 +11,22 @@ import org.bukkit.material.Wool;
import org.getspout.spoutapi.gui.Color;
public enum TeamKind {
WHITE (DyeColor.WHITE, Material.WOOL, ChatColor.WHITE, 450),
ORANGE (DyeColor.ORANGE, Material.WOOL, ChatColor.GOLD, 51),
MAGENTA (DyeColor.MAGENTA, Material.WOOL, ChatColor.LIGHT_PURPLE, 353),
BLUE (DyeColor.LIGHT_BLUE, Material.WOOL, ChatColor.BLUE, 23),
GOLD (DyeColor.YELLOW, Material.WOOL, ChatColor.YELLOW, 403), // yellow = gold
GREEN (DyeColor.LIME, Material.WOOL, ChatColor.GREEN, 612),
PINK (DyeColor.PINK, Material.WOOL, ChatColor.LIGHT_PURPLE, 929),
GRAY (DyeColor.GRAY, Material.WOOL, ChatColor.DARK_GRAY, 600),
IRON (DyeColor.SILVER, Material.WOOL, ChatColor.GRAY, 154), // lightgrey = iron
DIAMOND (DyeColor.CYAN, Material.WOOL, ChatColor.DARK_AQUA, 738), // cyan = diamond
PURPLE (DyeColor.PURPLE, Material.WOOL, ChatColor.DARK_PURPLE, 153),
NAVY (DyeColor.BLUE, Material.WOOL, ChatColor.DARK_BLUE, 939),
BROWN (DyeColor.BROWN, Material.WOOL, ChatColor.DARK_RED, 908),
DARKGREEN (DyeColor.GREEN, Material.WOOL, ChatColor.DARK_GREEN, 612),
RED (DyeColor.RED, Material.WOOL, ChatColor.RED, 245),
BLACK (DyeColor.BLACK, Material.WOOL, ChatColor.BLACK, 0);
WHITE (DyeColor.WHITE, Material.WHITE_WOOL, ChatColor.WHITE, 450),
ORANGE (DyeColor.ORANGE, Material.WHITE_WOOL, ChatColor.GOLD, 51),
MAGENTA (DyeColor.MAGENTA, Material.WHITE_WOOL, ChatColor.LIGHT_PURPLE, 353),
BLUE (DyeColor.LIGHT_BLUE, Material.WHITE_WOOL, ChatColor.BLUE, 23),
GOLD (DyeColor.YELLOW, Material.WHITE_WOOL, ChatColor.YELLOW, 403), // yellow = gold
GREEN (DyeColor.LIME, Material.WHITE_WOOL, ChatColor.GREEN, 612),
PINK (DyeColor.PINK, Material.WHITE_WOOL, ChatColor.LIGHT_PURPLE, 929),
GRAY (DyeColor.GRAY, Material.WHITE_WOOL, ChatColor.DARK_GRAY, 600),
IRON (DyeColor.GRAY, Material.WHITE_WOOL, ChatColor.GRAY, 154), // lightgrey = iron
DIAMOND (DyeColor.CYAN, Material.WHITE_WOOL, ChatColor.DARK_AQUA, 738), // cyan = diamond
PURPLE (DyeColor.PURPLE, Material.WHITE_WOOL, ChatColor.DARK_PURPLE, 153),
NAVY (DyeColor.BLUE, Material.WHITE_WOOL, ChatColor.DARK_BLUE, 939),
BROWN (DyeColor.BROWN, Material.WHITE_WOOL, ChatColor.DARK_RED, 908),
DARKGREEN (DyeColor.GREEN, Material.WHITE_WOOL, ChatColor.DARK_GREEN, 612),
RED (DyeColor.RED, Material.WHITE_WOOL, ChatColor.RED, 245),
BLACK (DyeColor.BLACK, Material.WHITE_WOOL, ChatColor.BLACK, 0);
private final DyeColor dyeColor;
private final ChatColor chatColor;
@ -156,7 +156,7 @@ public enum TeamKind {
* @return true if block is this team's color.
*/
public boolean isTeamBlock(BlockState block) {
if (block.getType() != Material.WOOL || !(block.getData() instanceof Wool)) {
if (block.getType() != Material.WHITE_WOOL || !(block.getData() instanceof Wool)) {
return false;
}
Wool wool = (Wool) block.getData();
@ -170,7 +170,7 @@ public enum TeamKind {
* @return true if item is this team's color.
*/
public boolean isTeamItem(ItemStack item) {
if (item.getType() != Material.WOOL || !(item.getData() instanceof Wool)) {
if (item.getType() != Material.WHITE_WOOL || !(item.getData() instanceof Wool)) {
return false;
}
Wool wool = (Wool) item.getData();

View File

@ -159,7 +159,7 @@ public class WarPlayerListener implements Listener {
if (War.war.isWandBearer(player)) {
Item item = event.getItemDrop();
if (item.getItemStack().getType() == Material.WOOD_SWORD) {
if (item.getItemStack().getType() == Material.WOODEN_SWORD) {
String zoneName = War.war.getWandBearerZone(player);
War.war.removeWandBearer(player);
War.war.msg(player, "drop.wand", zoneName);
@ -238,7 +238,7 @@ public class WarPlayerListener implements Listener {
public void onPlayerInteract(PlayerInteractEvent event) {
if (War.war.isLoaded()) {
Player player = event.getPlayer();
if (event.getItem() != null && event.getItem().getType() == Material.WOOD_SWORD && War.war.isWandBearer(player)) {
if (event.getItem() != null && event.getItem().getType() == Material.WOODEN_SWORD && War.war.isWandBearer(player)) {
String zoneName = War.war.getWandBearerZone(player);
ZoneSetter setter = new ZoneSetter(player, zoneName);
if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_AIR) {
@ -269,7 +269,7 @@ public class WarPlayerListener implements Listener {
War.war.badMsg(player, "use.ender");
}
Team team = Team.getTeamByPlayerName(player.getName());
if (zone != null && team != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENCHANTMENT_TABLE && team.getTeamConfig().resolveBoolean(TeamConfig.XPKILLMETER)) {
if (zone != null && team != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENCHANTING_TABLE && team.getTeamConfig().resolveBoolean(TeamConfig.XPKILLMETER)) {
event.setCancelled(true);
War.war.badMsg(player, "use.enchant");
if (zone.getAuthors().contains(player.getName())) {
@ -305,7 +305,7 @@ public class WarPlayerListener implements Listener {
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
if (zone != null && zone.getWarzoneConfig().getBoolean(WarzoneConfig.SOUPHEALING)) {
ItemStack item = event.getItem();
if ((item != null) && (item.getType() == Material.MUSHROOM_SOUP)) {
if ((item != null) && (item.getType() == Material.MUSHROOM_STEW)) {
if (player.getHealth() < 20) {
player.setHealth(Math.min(20, player.getHealth() + 7));
item.setType(Material.BOWL);
@ -340,7 +340,7 @@ public class WarPlayerListener implements Listener {
latestLocations.put(player.getName(), playerLoc);
// Signs can automatically teleport you to specific or random warzones
if (playerLoc.getBlock().getType() == Material.SIGN_POST) {
if (playerLoc.getBlock().getType() == Material.SIGN) {
Sign sign = (Sign) playerLoc.getBlock().getState();
if (sign.getLine(0).equals("[zone]")) {
Warzone indicated = Warzone.getZoneByName(sign.getLine(1));

View File

@ -78,7 +78,7 @@ public class HelmetProtectionTask implements Runnable {
player.getInventory().setItemInMainHand(null);
player.getInventory().setItemInOffHand(null);
player.getInventory().setHeldItemSlot(0);
player.getInventory().addItem(new ItemStack(Material.CAKE_BLOCK, 2240));
player.getInventory().addItem(new ItemStack(Material.CAKE, 2240));
}
}
}

View File

@ -97,7 +97,7 @@ public class Cake {
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
this.warzone.getWorld().getBlockAt(x, y + 1, z).setType(Material.CAKE_BLOCK);
this.warzone.getWorld().getBlockAt(x, y + 1, z).setType(Material.CAKE);
}
public boolean isCakeBlock(Location otherLocation) {

View File

@ -214,7 +214,7 @@ public class WarHub {
}
// War hub sign
locationBlock.getRelative(front, 2).setType(Material.SIGN_POST);
locationBlock.getRelative(front, 2).setType(Material.SIGN);
String[] lines = War.war.getString("sign.warhub").split("\n");
org.bukkit.block.Sign locationBlockFront = (org.bukkit.block.Sign) locationBlock.getRelative(front, 2).getState();
for (int i = 0; i < 4; i++) {

View File

@ -368,7 +368,7 @@ public class ZoneLobby {
// set zone sign
Block zoneSignBlock = this.lobbyMiddleWallBlock.getBlock().getRelative(this.wall, 4);
zoneSignBlock.setType(Material.SIGN_POST);
zoneSignBlock.setType(Material.SIGN);
org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneSignBlock.getState();
org.bukkit.material.Sign data = (Sign) block.getData();
data.setFacingDirection(this.wall);

View File

@ -29,15 +29,15 @@ public class ZoneWallGuard {
public static final Material[] glassifyBlocks = {
Material.AIR,
Material.WATER,
Material.LONG_GRASS,
Material.TALL_GRASS,
Material.VINE,
Material.WATER_LILY,
Material.YELLOW_FLOWER,
Material.RED_ROSE,
Material.LILY_PAD,
Material.DANDELION_YELLOW,
Material.ROSE_RED,
Material.RED_MUSHROOM,
Material.BROWN_MUSHROOM,
Material.DEAD_BUSH,
Material.SUGAR_CANE_BLOCK
Material.SUGAR_CANE
};
public ZoneWallGuard(Player player, War war, Warzone warzone, BlockFace wall) {

View File

@ -47,7 +47,7 @@ class EditLoadoutListUI extends ChestUI {
ItemStack item;
ItemMeta meta;
int i = 0;
item = new ItemStack(Material.GOLD_SPADE, 1);
item = new ItemStack(Material.GOLDEN_SHOVEL, 1);
meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GREEN + "Create new loadout");
item.setItemMeta(meta);

View File

@ -22,7 +22,7 @@ public class EditOrCreateZoneUI extends ChestUI {
@Override
public void build(final Player player, Inventory inv) {
int i = 0;
ItemStack item = new ItemStack(Material.WOOD_AXE, 1);
ItemStack item = new ItemStack(Material.WOODEN_AXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.YELLOW + "Create Warzone");
meta.setLore(ImmutableList.of(ChatColor.GRAY + "Click to create a " + ChatColor.AQUA + "Warzone"));
@ -34,7 +34,7 @@ public class EditOrCreateZoneUI extends ChestUI {
player.sendTitle("", ChatColor.RED + "This feature requires WorldEdit.", 10, 20, 10);
return;
}
player.getInventory().addItem(new ItemStack(Material.WOOD_AXE, 1));
player.getInventory().addItem(new ItemStack(Material.WOODEN_AXE, 1));
War.war.getUIManager().getPlayerMessage(player, "Select region for zone using WorldEdit and then type a name:", new StringRunnable() {
@Override
public void run() {
@ -55,7 +55,7 @@ public class EditOrCreateZoneUI extends ChestUI {
if (!War.war.isWarAdmin(player) && !zone.isAuthor(player)) {
continue;
}
item = new ItemStack(Material.BOOK_AND_QUILL);
item = new ItemStack(Material.WRITABLE_BOOK);
meta = item.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + zone.getName());
meta.setLore(ImmutableList.of(ChatColor.GRAY + "Click to edit"));

View File

@ -29,7 +29,7 @@ class EditTeamUI extends ChestUI {
ItemStack item;
ItemMeta meta;
int i = 0;
item = new ItemStack(Material.GOLD_SPADE, 1);
item = new ItemStack(Material.GOLDEN_SHOVEL, 1);
meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GREEN + "Add additional spawn");
item.setItemMeta(meta);
@ -77,7 +77,7 @@ class EditTeamUI extends ChestUI {
War.war.msg(player, "Team " + team.getName() + " removed.");
}
});
item = new ItemStack(Material.SNOW_BALL);
item = new ItemStack(Material.SNOWBALL);
meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GRAY + "" + ChatColor.BOLD + "Restore Defaults");
item.setItemMeta(meta);

View File

@ -28,7 +28,7 @@ public class EditZoneConfigUI extends ChestUI {
int i = 0;
i = UIConfigHelper.addWarzoneConfigOptions(this, player, inv, zone.getWarzoneConfig(), zone, i);
item = new ItemStack(Material.STAINED_GLASS_PANE);
item = new ItemStack(Material.LEGACY_STAINED_GLASS_PANE);
meta = item.getItemMeta();
meta.setDisplayName(">>>> Team Default Config >>>>");
item.setItemMeta(meta);
@ -39,7 +39,7 @@ public class EditZoneConfigUI extends ChestUI {
}
});
UIConfigHelper.addTeamConfigOptions(this, player, inv, zone.getTeamDefaultConfig(), null, zone, i);
item = new ItemStack(Material.SNOW_BALL);
item = new ItemStack(Material.SNOWBALL);
meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GRAY + "" + ChatColor.BOLD + "Restore Defaults");
item.setItemMeta(meta);

View File

@ -19,7 +19,7 @@ public class WarAdminUI extends ChestUI {
int i = 0;
i = UIConfigHelper.addWarConfigOptions(this, player, inv, War.war.getWarConfig(), i);
item = new ItemStack(Material.STAINED_GLASS_PANE);
item = new ItemStack(Material.LEGACY_STAINED_GLASS_PANE);
meta = item.getItemMeta();
meta.setDisplayName(">>>> Warzone Default Config >>>>");
item.setItemMeta(meta);
@ -30,7 +30,7 @@ public class WarAdminUI extends ChestUI {
}
});
i = UIConfigHelper.addWarzoneConfigOptions(this, player, inv, War.war.getWarzoneDefaultConfig(), null, i);
item = new ItemStack(Material.STAINED_GLASS_PANE);
item = new ItemStack(Material.LEGACY_STAINED_GLASS_PANE);
meta = item.getItemMeta();
meta.setDisplayName(">>>> Team Default Config >>>>");
item.setItemMeta(meta);

View File

@ -47,7 +47,7 @@ public class WarUI extends ChestUI {
}
private ItemStack getCreateWarzoneItem() {
ItemStack item = new ItemStack(Material.WOOD_AXE, 1);
ItemStack item = new ItemStack(Material.WOODEN_AXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Create Warzone");
meta.setLore(ImmutableList.of(ChatColor.GRAY + "Click to create, or edit a " + ChatColor.AQUA + "Warzone" + ChatColor.GRAY + "."));
@ -66,7 +66,7 @@ public class WarUI extends ChestUI {
}
private ItemStack getWarAdminItem() {
ItemStack item = new ItemStack(Material.EYE_OF_ENDER, 1);
ItemStack item = new ItemStack(Material.ENDER_EYE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.DARK_RED + "" + ChatColor.BOLD + "Manage War");
meta.setLore(ImmutableList.of(ChatColor.GRAY + "Click to display " + ChatColor.DARK_RED + "Admin" + ChatColor.GRAY + " access panel",

View File

@ -286,25 +286,25 @@ public class Volume {
for (int y = this.getMinY(); y <= this.getMaxY(); y++) {
for (int z = this.getMinZ(); z <= this.getMaxZ(); z++) {
switch (this.getWorld().getBlockAt(x, y, z).getType()) {
case SIGN_POST:
case SIGN:
case WALL_SIGN:
case IRON_DOOR:
case WOOD_DOOR:
case LEGACY_SAPLING:
case LADDER:
case YELLOW_FLOWER:
case RED_ROSE:
case DANDELION_YELLOW:
case ROSE_RED:
case RED_MUSHROOM:
case BROWN_MUSHROOM:
case SAPLING:
case OAK_SAPLING:
case TORCH:
case RAILS:
case RAIL:
case STONE_BUTTON:
case STONE_PLATE:
case WOOD_PLATE:
case STONE_PRESSURE_PLATE:
case LEGACY_WOOD_PLATE:
case LEVER:
case REDSTONE:
case REDSTONE_TORCH_ON:
case REDSTONE_TORCH_OFF:
case LEGACY_REDSTONE_TORCH_ON:
case LEGACY_REDSTONE_TORCH_OFF:
case CACTUS:
case SNOW:
case ICE: