mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Merge pull request #393 from jedk1/master
Update ComboManager to new ClickTypes & NPE
This commit is contained in:
commit
9e2df0a138
5 changed files with 16 additions and 9 deletions
|
@ -23,7 +23,6 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.FallingBlock;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -36,7 +35,7 @@ public abstract class EarthAbility extends ElementalAbility {
|
||||||
private static final ConcurrentHashMap<Block, Information> MOVED_EARTH = new ConcurrentHashMap<Block, Information>();
|
private static final ConcurrentHashMap<Block, Information> MOVED_EARTH = new ConcurrentHashMap<Block, Information>();
|
||||||
private static final ConcurrentHashMap<Integer, Information> TEMP_AIR_LOCATIONS = new ConcurrentHashMap<Integer, Information>();
|
private static final ConcurrentHashMap<Integer, Information> TEMP_AIR_LOCATIONS = new ConcurrentHashMap<Integer, Information>();
|
||||||
private static final ArrayList<Block> PREVENT_PHYSICS = new ArrayList<Block>();
|
private static final ArrayList<Block> PREVENT_PHYSICS = new ArrayList<Block>();
|
||||||
private static final ItemStack DIAMOND_PICKAXE = new ItemStack(Material.DIAMOND_PICKAXE);
|
//private static final ItemStack DIAMOND_PICKAXE = new ItemStack(Material.DIAMOND_PICKAXE);
|
||||||
|
|
||||||
public EarthAbility(Player player) {
|
public EarthAbility(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
|
@ -563,8 +562,8 @@ public abstract class EarthAbility extends ElementalAbility {
|
||||||
if (sourceblock.getType() == Material.AIR || sourceblock.isLiquid()) {
|
if (sourceblock.getType() == Material.AIR || sourceblock.isLiquid()) {
|
||||||
info.getState().update(true);
|
info.getState().update(true);
|
||||||
} else {
|
} else {
|
||||||
GeneralMethods.dropItems(block,
|
//GeneralMethods.dropItems(block,
|
||||||
GeneralMethods.getDrops(block, info.getState().getType(), info.getState().getRawData(), DIAMOND_PICKAXE));
|
// GeneralMethods.getDrops(block, info.getState().getType(), info.getState().getRawData(), DIAMOND_PICKAXE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GeneralMethods.isAdjacentToThreeOrMoreSources(block)) {
|
if (GeneralMethods.isAdjacentToThreeOrMoreSources(block)) {
|
||||||
|
|
|
@ -75,8 +75,8 @@ public class ComboManager {
|
||||||
|
|
||||||
ArrayList<AbilityInformation> fireWheel = new ArrayList<>();
|
ArrayList<AbilityInformation> fireWheel = new ArrayList<>();
|
||||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.SHIFT_DOWN));
|
fireWheel.add(new AbilityInformation("FireShield", ClickType.SHIFT_DOWN));
|
||||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK));
|
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK_BLOCK));
|
||||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK));
|
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK_BLOCK));
|
||||||
fireWheel.add(new AbilityInformation("Blaze", ClickType.SHIFT_UP));
|
fireWheel.add(new AbilityInformation("Blaze", ClickType.SHIFT_UP));
|
||||||
COMBO_ABILITIES.put("FireWheel", new ComboAbilityInfo("FireWheel", fireWheel, FireCombo.class));
|
COMBO_ABILITIES.put("FireWheel", new ComboAbilityInfo("FireWheel", fireWheel, FireCombo.class));
|
||||||
DESCRIPTIONS.put("FireWheel", "A high-speed wheel of fire that travels along the ground for long distances dealing high damage.");
|
DESCRIPTIONS.put("FireWheel", "A high-speed wheel of fire that travels along the ground for long distances dealing high damage.");
|
||||||
|
|
|
@ -73,7 +73,13 @@ public class AirBubble extends AirAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void progress() {
|
public void progress() {
|
||||||
if (!player.isSneaking() || !bPlayer.canBend(this)) {
|
if (!player.isSneaking()) {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
} else if (!waterBubble && !bPlayer.canBend(this)) {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
} else if (waterBubble && !bPlayer.canBend(getAbility("WaterBubble"))) {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class RemoveCommand extends PKCommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sender.sendMessage(e.getColor() + "You have removed your " + e.toString().toLowerCase() + "bending.");
|
sender.sendMessage(e.getColor() + "You have removed your " + e.toString().toLowerCase() + "bending.");
|
||||||
Bukkit.getServer().getPluginManager().callEvent(new PlayerChangeElementEvent(sender, player, e, Result.REMOVE));
|
Bukkit.getServer().getPluginManager().callEvent(new PlayerChangeElementEvent(sender, (Player) sender, e, Result.REMOVE));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.RED + "You do not have that element!");
|
sender.sendMessage(ChatColor.RED + "You do not have that element!");
|
||||||
|
|
|
@ -216,7 +216,9 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
progressing = false;
|
progressing = false;
|
||||||
}
|
}
|
||||||
originalSource.revertBlock();
|
originalSource.revertBlock();
|
||||||
bPlayer.addCooldown("IceSpikeBlast", cooldown);
|
if (player != null && player.isOnline()) {
|
||||||
|
bPlayer.addCooldown("IceSpikeBlast", cooldown);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void returnWater() {
|
private void returnWater() {
|
||||||
|
|
Loading…
Reference in a new issue