Merge pull request #458 from OmniCypher-/master

Various Fixes
This commit is contained in:
OmniCypher 2016-03-28 15:35:39 -07:00
commit dded537a52
7 changed files with 23 additions and 18 deletions

View file

@ -142,6 +142,7 @@ import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerMoveEvent;
@ -968,7 +969,6 @@ public class PKListener implements Listener {
|| type == Material.LEAVES || type == Material.LEAVES_2
|| type == Material.LEATHER_LEGGINGS || type == Material.AIR)) {
newDrops.add(drops.get(i));
Bukkit.broadcastMessage("Adding " + drops.get(i));
}
}
if (plantArmor.getOldArmor() != null) {
@ -1251,12 +1251,6 @@ public class PKListener implements Listener {
BlockSource.update(player, ClickType.SHIFT_DOWN);
}
WaterArms waterArms = CoreAbility.getAbility(player, WaterArms.class);
if (!player.isSneaking() && waterArms != null) {
waterArms.displayBoundMsg();
return;
}
AirScooter.check(player);
@ -1418,6 +1412,17 @@ public class PKListener implements Listener {
}
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerSlotChange(PlayerItemHeldEvent event) {
Player player = event.getPlayer();
WaterArms waterArms = CoreAbility.getAbility(player, WaterArms.class);
if (waterArms != null) {
waterArms.displayBoundMsg(event.getNewSlot()+1);
return;
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerSwing(PlayerAnimationEvent event) {

View file

@ -196,7 +196,6 @@ public class ComboManager {
}
list.add(info);
RECENTLY_USED.put(name, list);
//Bukkit.broadcastMessage("recentlyUsedAbilities: " + recentlyUsedAbilities.get(name).size());
}
/**

View file

@ -163,7 +163,7 @@ public class AirSpout extends AirAbility {
@Override
public boolean isSneakAbility() {
return true;
return false;
}
@Override

View file

@ -51,7 +51,7 @@ public class ClearCommand extends PKCommand {
for (int i = 1; i <= 9; i++) {
GeneralMethods.saveAbility(bPlayer, i, null);
}
sender.sendMessage(cleared);
sender.sendMessage(ChatColor.YELLOW + cleared);
} else if (args.size() == 1) {
try {
int slot = Integer.parseInt(args.get(0));
@ -63,7 +63,7 @@ public class ClearCommand extends PKCommand {
GeneralMethods.saveAbility(bPlayer, slot, null);
sender.sendMessage(clearedSlot.replace("{slot}", String.valueOf(slot)));
} else {
sender.sendMessage(alreadyEmpty);
sender.sendMessage(ChatColor.YELLOW + alreadyEmpty);
}
} catch (NumberFormatException e) {
sender.sendMessage(ChatColor.RED + wrongNumber);

View file

@ -190,12 +190,12 @@ public class ConfigManager {
config.addDefault("Commands.Check.UpToDate", "You have the latest version of ProjectKorra.");
config.addDefault("Commands.Bind.Description", "This command will bind an ability to the slot you specify (if you specify one), or the slot currently selected in your hotbar (If you do not specify a Slot #).");
config.addDefault("Commands.Bind.AbilityDoesntExist", "This command will bind an ability to the slot you specify (if you specify one), or the slot currently selected in your hotbar (If you do not specify a Slot #).");
config.addDefault("Commands.Bind.AbilityDoesntExist", "{ability} is not a valid ability.");
config.addDefault("Commands.Bind.WrongNumber", "Slot must be an integer between 1 and 9.");
config.addDefault("Commands.Bind.ElementToggledOff", "You have that ability's element toggled off currently.");
config.addDefault("Commands.Bind.SuccessfullyBound", "Succesfully bound {ability} to slot {slot}.");
config.addDefault("Commands.Add.Choose", "This command will allow the user to add an element to the targeted <Player>, or themselves if the target is not specified. This command is typically reserved for server administrators.");
config.addDefault("Commands.Add.Description", "This command will allow the user to add an element to the targeted <Player>, or themselves if the target is not specified. This command is typically reserved for server administrators.");
config.addDefault("Commands.Add.SuccessfullyAdded", "You are now also a {element}.");
config.addDefault("Commands.Add.PlayerNotFound", "That player could not be found.");
config.addDefault("Commands.Add.InvalidElement", "You must specify a valid element.");

View file

@ -140,7 +140,6 @@ public class WaterArms extends WaterAbility {
remove();
return;
}
displayBoundMsg();
}
}
@ -419,8 +418,11 @@ public class WaterArms extends WaterAbility {
return false;
}
public void displayBoundMsg() {
player.sendMessage(getElement().getColor() + sneakMsg + " " + bPlayer.getBoundAbilityName());
public void displayBoundMsg(int slot) {
String name = bPlayer.getAbilities().get(slot);
if(name != null) {
player.sendMessage(getElement().getColor() + sneakMsg + " " + name);
}
}
/**

View file

@ -211,8 +211,7 @@ public class WaterArmsSpear extends WaterAbility {
}
private void createIceBall() {
layer++;
for (Block block : GeneralMethods.getBlocksAroundPoint(location, layer)) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, spearSphere)) {
if (isTransparent(player, block) && block.getType() != Material.ICE && !WaterArms.isUnbreakable(block)) {
playIcebendingSound(block.getLocation());
new TempBlock(block, Material.ICE, (byte) 0);