mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-14 04:47:51 +00:00
Fix LavaSurge creating permanent lava
This commit is contained in:
parent
f584ff774f
commit
8d6d7321ee
2 changed files with 11 additions and 0 deletions
|
@ -13,6 +13,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -582,6 +583,13 @@ public class PKListener implements Listener {
|
|||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity))
|
||||
event.setCancelled(true);
|
||||
|
||||
if (event.getEntityType() == EntityType.FALLING_BLOCK) {
|
||||
if (LavaSurge.falling.contains(entity)) {
|
||||
LavaSurge.falling.remove(entity);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
|
|
|
@ -32,6 +32,7 @@ public class LavaSurge
|
|||
public static int travelRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.LavaSurge.TravelRange");
|
||||
public static int maxBlocks = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.LavaSurge.MaxLavaWaves");
|
||||
public static boolean canSourceBeEarth = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.LavaSurge.SourceCanBeEarth");
|
||||
public static List<FallingBlock> falling = new ArrayList<FallingBlock>();
|
||||
public static int particleInterval = 100;
|
||||
public static int fallingBlockInterval = 100;
|
||||
|
||||
|
@ -264,6 +265,7 @@ public class LavaSurge
|
|||
{
|
||||
FallingBlock fbs = player.getWorld().spawnFallingBlock(sourceBlock.getLocation().add(0, 1, 0), Material.STATIONARY_LAVA, (byte) 0);
|
||||
fblocks.add(fbs);
|
||||
falling.add(fbs);
|
||||
double x = randy.nextDouble()/5;
|
||||
double z = randy.nextDouble()/5;
|
||||
|
||||
|
@ -278,6 +280,7 @@ public class LavaSurge
|
|||
if(randy.nextBoolean() && b != sourceBlock)
|
||||
{
|
||||
FallingBlock fb = player.getWorld().spawnFallingBlock(b.getLocation().add(new Vector(0, 1, 0)), Material.STATIONARY_LAVA, (byte) 0);
|
||||
falling.add(fb);
|
||||
fblocks.add(fb);
|
||||
fb.setVelocity(direction.clone().add(new Vector(randy.nextDouble()/10, 0.1, randy.nextDouble()/10)).multiply(1.2));
|
||||
fb.setDropItem(false);
|
||||
|
|
Loading…
Reference in a new issue