First update to 1.9. Sadly makes it not work w/ 1.8
This commit is contained in:
@@ -48,7 +48,7 @@ public class PlayerListener implements Listener {
|
||||
Location loc = event.getClickedBlock() == null ? p.getLocation() : event.getClickedBlock().getLocation();
|
||||
JailManager jm = pl.getJailManager();
|
||||
|
||||
if(p.getItemInHand().isSimilar(Util.getWand())) {
|
||||
if(p.getInventory().getItemInMainHand().isSimilar(Util.getWand())) {
|
||||
if(jm.isCreatingSomething(p.getName())) {
|
||||
if(jm.isCreatingAJail(p.getName())) {
|
||||
pl.debug("Stepping into creating a jail.");
|
||||
@@ -225,8 +225,8 @@ public class PlayerListener implements Listener {
|
||||
Player player = (Player) event.getEntity();
|
||||
|
||||
if(pl.getJailStickManager().isUsingJailStick(attacker.getUniqueId())) {
|
||||
if(pl.getJailStickManager().isValidStick(attacker.getItemInHand().getType())) {
|
||||
if(attacker.hasPermission("jail.usejailstick." + attacker.getItemInHand().getType().toString().toLowerCase())) {
|
||||
if(pl.getJailStickManager().isValidStick(attacker.getInventory().getItemInMainHand().getType())) {
|
||||
if(attacker.hasPermission("jail.usejailstick." + attacker.getInventory().getItemInMainHand().getType().toString().toLowerCase())) {
|
||||
//The person the attacker is trying to jail stick is already jailed, don't handle that
|
||||
if(pl.getJailManager().isPlayerJailed(player.getUniqueId())) {
|
||||
attacker.sendMessage(Lang.ALREADYJAILED.get(player.getName()));
|
||||
@@ -234,7 +234,7 @@ public class PlayerListener implements Listener {
|
||||
if(player.hasPermission("jail.cantbejailed")) {
|
||||
attacker.sendMessage(Lang.CANTBEJAILED.get());
|
||||
}else {
|
||||
Stick s = pl.getJailStickManager().getStick(attacker.getItemInHand().getType());
|
||||
Stick s = pl.getJailStickManager().getStick(attacker.getInventory().getItemInMainHand().getType());
|
||||
|
||||
if(player.getHealth() <= s.getHealth() || s.getHealth() == -1) {
|
||||
Prisoner p = new Prisoner(player.getUniqueId().toString(), player.getName(),
|
||||
|
@@ -289,7 +289,7 @@ public class ProtectionListener implements Listener {
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}else if (event.getPlayer().getItemInHand() != null) {
|
||||
}else if (event.getPlayer().getInventory().getItemInMainHand() != null) {
|
||||
//Otherwise let's check if they have something in hand
|
||||
//Get the interaction blacklist, check if the current item is in there
|
||||
//if it is, then let's take action
|
||||
|
@@ -37,8 +37,8 @@ public class CellCreationSteps {
|
||||
if(player.getInventory().contains(wand)) {
|
||||
int i = player.getInventory().first(wand);
|
||||
if(i != -1) {
|
||||
player.getInventory().setItem(i, player.getItemInHand());
|
||||
player.setItemInHand(wand);
|
||||
player.getInventory().setItem(i, player.getInventory().getItemInMainHand());
|
||||
player.getInventory().setItemInMainHand(wand);
|
||||
}
|
||||
}else {
|
||||
player.getInventory().addItem(wand);
|
||||
|
@@ -30,8 +30,8 @@ public class JailCreationSteps {
|
||||
if(player.getInventory().contains(wand)) {
|
||||
int i = player.getInventory().first(wand);
|
||||
if(i != -1) {
|
||||
player.getInventory().setItem(i, player.getItemInHand());
|
||||
player.setItemInHand(wand);
|
||||
player.getInventory().setItem(i, player.getInventory().getItemInMainHand());
|
||||
player.getInventory().setItemInMainHand(wand);
|
||||
}
|
||||
}else {
|
||||
player.getInventory().addItem(wand);
|
||||
|
Reference in New Issue
Block a user