From a7fd4853085084d626c9eaaf1ff36ecf27bad5f3 Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Thu, 17 Jan 2019 22:23:55 -0500 Subject: [PATCH] fix CME in densityshift, allow kelp to be cooked with heatcontrol, fix earthgrab on tridents --- .../projectkorra/earthbending/EarthGrab.java | 7 +++- .../earthbending/passive/DensityShift.java | 20 +++++----- .../projectkorra/firebending/HeatControl.java | 38 ++++++++----------- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java b/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java index b84c4801..bc34748e 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java @@ -292,8 +292,11 @@ public class EarthGrab extends EarthAbility { if (!isEarth(entity.getLocation().clone().subtract(0, 1, 0).getBlock()) && (this.bPlayer.canSandbend() && !isSand(entity.getLocation().clone().subtract(0, 1, 0).getBlock())) && entity.getLocation().clone().subtract(0, 1, 0).getBlock().getType() != Material.FARMLAND) { continue; } - - if (entity instanceof Arrow) { + if (entity instanceof Trident) { + final Location l = entity.getLocation(); + entity.remove(); + entity = l.getWorld().dropItem(l, new ItemStack(Material.TRIDENT, 1)); + } else if (entity instanceof Arrow) { final Location l = entity.getLocation(); entity.remove(); entity = l.getWorld().dropItem(l, new ItemStack(Material.ARROW, 1)); diff --git a/src/com/projectkorra/projectkorra/earthbending/passive/DensityShift.java b/src/com/projectkorra/projectkorra/earthbending/passive/DensityShift.java index ea7e9d7f..71b35d36 100644 --- a/src/com/projectkorra/projectkorra/earthbending/passive/DensityShift.java +++ b/src/com/projectkorra/projectkorra/earthbending/passive/DensityShift.java @@ -1,14 +1,5 @@ package com.projectkorra.projectkorra.earthbending.passive; -import java.util.HashSet; -import java.util.Set; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Player; - import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.EarthAbility; @@ -18,6 +9,14 @@ import com.projectkorra.projectkorra.command.Commands; import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock.RevertTask; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; + +import java.util.HashSet; +import java.util.Set; public class DensityShift extends EarthAbility implements PassiveAbility { private static final Set SAND_BLOCKS = new HashSet<>(); @@ -86,7 +85,8 @@ public class DensityShift extends EarthAbility implements PassiveAbility { } public static void revertAllSand() { - for (final TempBlock block : SAND_BLOCKS) { + Set sandtoremove = new HashSet<>(SAND_BLOCKS); + for (final TempBlock block : sandtoremove) { block.revertBlock(); } } diff --git a/src/com/projectkorra/projectkorra/firebending/HeatControl.java b/src/com/projectkorra/projectkorra/firebending/HeatControl.java index 2c76d160..eff789da 100644 --- a/src/com/projectkorra/projectkorra/firebending/HeatControl.java +++ b/src/com/projectkorra/projectkorra/firebending/HeatControl.java @@ -1,26 +1,5 @@ package com.projectkorra.projectkorra.firebending; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -import org.bukkit.Effect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.data.Levelled; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; @@ -36,6 +15,18 @@ import com.projectkorra.projectkorra.waterbending.WaterSpoutWave; import com.projectkorra.projectkorra.waterbending.combo.IceWave; import com.projectkorra.projectkorra.waterbending.ice.PhaseChange; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsSpear; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.block.data.Levelled; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +import java.util.*; public class HeatControl extends FireAbility { @@ -43,7 +34,7 @@ public class HeatControl extends FireAbility { COOK, EXTINGUISH, MELT, SOLIDIFY } - private static final Material[] COOKABLE_MATERIALS = { Material.BEEF, Material.CHICKEN, Material.COD, Material.PORKCHOP, Material.POTATO, Material.RABBIT, Material.MUTTON, Material.SALMON }; + private static final Material[] COOKABLE_MATERIALS = { Material.BEEF, Material.CHICKEN, Material.COD, Material.PORKCHOP, Material.POTATO, Material.RABBIT, Material.MUTTON, Material.SALMON, Material.KELP }; private HeatControlType heatControlType; @@ -270,6 +261,9 @@ public class HeatControl extends FireAbility { case SALMON: cooked = new ItemStack(Material.COOKED_SALMON); break; + case KELP: + cooked = new ItemStack(Material.DRIED_KELP); + break; default: break; }