From 4c44e512378a4cdb13d1accab9c4f44a4cbc7495 Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Wed, 2 Jan 2019 08:21:09 -0500 Subject: [PATCH 1/3] this particle requires blockdata --- .../projectkorra/ability/WaterAbility.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/com/projectkorra/projectkorra/ability/WaterAbility.java b/src/com/projectkorra/projectkorra/ability/WaterAbility.java index 4c900a9c..fb7a5399 100644 --- a/src/com/projectkorra/projectkorra/ability/WaterAbility.java +++ b/src/com/projectkorra/projectkorra/ability/WaterAbility.java @@ -1,18 +1,5 @@ package com.projectkorra.projectkorra.ability; -import java.util.HashSet; -import java.util.Set; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.data.Levelled; -import org.bukkit.entity.Player; -import org.bukkit.util.Vector; - import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.GeneralMethods; @@ -28,6 +15,18 @@ import com.projectkorra.projectkorra.waterbending.Torrent; import com.projectkorra.projectkorra.waterbending.WaterSpout; import com.projectkorra.projectkorra.waterbending.ice.PhaseChange; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Levelled; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + +import java.util.HashSet; +import java.util.Set; public abstract class WaterAbility extends ElementalAbility { @@ -74,7 +73,7 @@ public abstract class WaterAbility extends ElementalAbility { public void handleCollision(final Collision collision) { super.handleCollision(collision); if (collision.isRemovingFirst()) { - ParticleEffect.BLOCK_CRACK.display(collision.getLocationFirst(), 10, 1, 1, 1, 0.1); + ParticleEffect.BLOCK_CRACK.display(collision.getLocationFirst(), 10, 1, 1, 1, 0.1, collision.getLocationFirst().getBlock().getBlockData()); } } From bb912f0423a0e54642a7d2f43688686f02881b11 Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Wed, 2 Jan 2019 09:43:48 -0500 Subject: [PATCH 2/3] fix earthsmash --- .../projectkorra/earthbending/EarthSmash.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java b/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java index 19287dc8..d726e088 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java @@ -1,9 +1,13 @@ package com.projectkorra.projectkorra.earthbending; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import com.projectkorra.projectkorra.BendingPlayer; +import com.projectkorra.projectkorra.GeneralMethods; +import com.projectkorra.projectkorra.ability.EarthAbility; +import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.util.ClickType; +import com.projectkorra.projectkorra.util.DamageHandler; +import com.projectkorra.projectkorra.util.ParticleEffect; +import com.projectkorra.projectkorra.util.TempBlock; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -14,14 +18,9 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; -import com.projectkorra.projectkorra.BendingPlayer; -import com.projectkorra.projectkorra.GeneralMethods; -import com.projectkorra.projectkorra.ability.EarthAbility; -import com.projectkorra.projectkorra.attribute.Attribute; -import com.projectkorra.projectkorra.util.ClickType; -import com.projectkorra.projectkorra.util.DamageHandler; -import com.projectkorra.projectkorra.util.ParticleEffect; -import com.projectkorra.projectkorra.util.TempBlock; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class EarthSmash extends EarthAbility { @@ -230,7 +229,6 @@ public class EarthSmash extends EarthAbility { break; } } - this.draw(); return; } else { @@ -537,7 +535,7 @@ public class EarthSmash extends EarthAbility { return null; } - final List blocks = GeneralMethods.getBlocksAroundPoint(GeneralMethods.getTargetedLocation(player, this.grabRange, getTransparentMaterials()), 1); + final List blocks = GeneralMethods.getBlocksAroundPoint(GeneralMethods.getTargetedLocation(player, this.grabRange, false, getTransparentMaterials()), 1); for (final EarthSmash smash : getAbilities(EarthSmash.class)) { if (reqState == null || smash.state == reqState) { for (final Block block : blocks) { From e4e179bd444490b291312aa3a2c2c90d3e52c81e Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Wed, 2 Jan 2019 11:21:22 -0500 Subject: [PATCH 3/3] fix firebending with worldguard --- src/com/projectkorra/projectkorra/GeneralMethods.java | 4 +++- src/com/projectkorra/projectkorra/airbending/AirSuction.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/GeneralMethods.java b/src/com/projectkorra/projectkorra/GeneralMethods.java index 550462c5..ec0f784a 100644 --- a/src/com/projectkorra/projectkorra/GeneralMethods.java +++ b/src/com/projectkorra/projectkorra/GeneralMethods.java @@ -50,6 +50,7 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldguard.WorldGuard; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.protection.flags.Flags; +import com.sk89q.worldguard.protection.flags.StateFlag; import com.songoda.kingdoms.constants.land.Land; import com.songoda.kingdoms.constants.land.SimpleChunkLocation; import com.songoda.kingdoms.constants.player.KingdomPlayer; @@ -1428,7 +1429,8 @@ public class GeneralMethods { if (wg.getPlatform().getGlobalStateManager().get(BukkitAdapter.adapt(location.getWorld())).blockTNTExplosions) { return true; } - if (!wg.getPlatform().getRegionContainer().createQuery().testState(BukkitAdapter.adapt(location), WorldGuardPlugin.inst().wrapPlayer(player), Flags.TNT)) { + StateFlag.State tntflag = wg.getPlatform().getRegionContainer().createQuery().queryState(BukkitAdapter.adapt(location), WorldGuardPlugin.inst().wrapPlayer(player), Flags.TNT); + if (tntflag != null && tntflag.equals(StateFlag.State.DENY)) { return true; } } diff --git a/src/com/projectkorra/projectkorra/airbending/AirSuction.java b/src/com/projectkorra/projectkorra/airbending/AirSuction.java index a85e7b32..b5707469 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirSuction.java +++ b/src/com/projectkorra/projectkorra/airbending/AirSuction.java @@ -132,7 +132,7 @@ public class AirSuction extends AirAbility { ignore[i] = AirBlast.TDOORS[i - getTransparentMaterials().length - AirBlast.DOORS.length]; } } - final Location location = GeneralMethods.getTargetedLocation(player, getSelectRange(), ignore); + final Location location = GeneralMethods.getTargetedLocation(player, getSelectRange(), false, ignore); if (location.getBlock().isLiquid() || GeneralMethods.isSolid(location.getBlock())) { return; } else if (GeneralMethods.isRegionProtectedFromBuild(player, "AirSuction", location)) {