fix CME in densityshift, allow kelp to be cooked with heatcontrol, fix earthgrab on tridents

This commit is contained in:
PhanaticD 2019-01-17 22:23:55 -05:00
parent 8aa84fc23c
commit a7fd485308
3 changed files with 31 additions and 34 deletions

View file

@ -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) { 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; continue;
} }
if (entity instanceof Trident) {
if (entity instanceof Arrow) { 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(); final Location l = entity.getLocation();
entity.remove(); entity.remove();
entity = l.getWorld().dropItem(l, new ItemStack(Material.ARROW, 1)); entity = l.getWorld().dropItem(l, new ItemStack(Material.ARROW, 1));

View file

@ -1,14 +1,5 @@
package com.projectkorra.projectkorra.earthbending.passive; 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.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; 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.configuration.ConfigManager;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempBlock.RevertTask; 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 { public class DensityShift extends EarthAbility implements PassiveAbility {
private static final Set<TempBlock> SAND_BLOCKS = new HashSet<>(); private static final Set<TempBlock> SAND_BLOCKS = new HashSet<>();
@ -86,7 +85,8 @@ public class DensityShift extends EarthAbility implements PassiveAbility {
} }
public static void revertAllSand() { public static void revertAllSand() {
for (final TempBlock block : SAND_BLOCKS) { Set<TempBlock> sandtoremove = new HashSet<>(SAND_BLOCKS);
for (final TempBlock block : sandtoremove) {
block.revertBlock(); block.revertBlock();
} }
} }

View file

@ -1,26 +1,5 @@
package com.projectkorra.projectkorra.firebending; 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.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; 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.combo.IceWave;
import com.projectkorra.projectkorra.waterbending.ice.PhaseChange; import com.projectkorra.projectkorra.waterbending.ice.PhaseChange;
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsSpear; 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 { public class HeatControl extends FireAbility {
@ -43,7 +34,7 @@ public class HeatControl extends FireAbility {
COOK, EXTINGUISH, MELT, SOLIDIFY 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; private HeatControlType heatControlType;
@ -270,6 +261,9 @@ public class HeatControl extends FireAbility {
case SALMON: case SALMON:
cooked = new ItemStack(Material.COOKED_SALMON); cooked = new ItemStack(Material.COOKED_SALMON);
break; break;
case KELP:
cooked = new ItemStack(Material.DRIED_KELP);
break;
default: default:
break; break;
} }