Remove more deprecation, RC2

This commit is contained in:
Connor Monahan 2018-12-05 15:31:58 -06:00
parent 374ec7b8de
commit 97052deec6
3 changed files with 4 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tommytony</groupId>
<artifactId>war</artifactId>
<version>2.0.0-RC1</version>
<version>2.0.0-RC2</version>
<packaging>jar</packaging>
<name>War</name>
<url>http://war.tommytony.com</url>

View File

@ -299,8 +299,7 @@ public class WarBlockListener implements Listener {
} else {
Bomb bomb = warzone.getBombForBlock(block);
// player just broke the bomb block: cancel to avoid drop, give player the block, set block to air
ItemStack tntBlock = new ItemStack(Material.TNT);
tntBlock.setDurability((short)8);
ItemStack tntBlock = new ItemStack(Material.TNT, 1);
player.getInventory().clear();
player.getInventory().addItem(tntBlock);
warzone.addBombThief(bomb, player);
@ -323,7 +322,6 @@ public class WarBlockListener implements Listener {
Cake cake = warzone.getCakeForBlock(block);
// player just broke the cake block: cancel to avoid drop, give player the block, set block to air
ItemStack cakeBlock = new ItemStack(Material.CAKE);
cakeBlock.setDurability((short)8);
player.getInventory().clear();
player.getInventory().addItem(cakeBlock);
warzone.addCakeThief(cake, player);

View File

@ -75,9 +75,8 @@ public class UIManager implements Listener {
Player player = event.getPlayer();
ItemStack item = event.getItem();
if (item != null && item.getType() == Material.TNT
&& (item.getDurability() == 7 ||
(item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().contains("War")))) {
&& item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().contains("War")) {
event.setCancelled(true);
this.assignUI(player, new WarUI());
}