mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Edited LavaFlow and WaterSpout
LavaFlow will now revert generated stone back to lava after the configured delay. WaterSpout now displays splash particles.
This commit is contained in:
parent
19a7046eb5
commit
941644be7a
2 changed files with 52 additions and 2 deletions
|
@ -64,6 +64,7 @@ public class LavaFlow
|
|||
|
||||
public static ArrayList<LavaFlow> instances = new ArrayList<LavaFlow>();
|
||||
public static ArrayList<TempBlock> totalBlocks = new ArrayList<TempBlock>();
|
||||
public static ArrayList<TempBlock> totalBlocks2 = new ArrayList<TempBlock>();
|
||||
|
||||
private Player player;
|
||||
private BendingPlayer bplayer;
|
||||
|
@ -333,6 +334,7 @@ public class LavaFlow
|
|||
TempBlock.instances.remove(block);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
public void removeLava(Block testBlock)
|
||||
{
|
||||
/**
|
||||
|
@ -350,7 +352,10 @@ public class LavaFlow
|
|||
return;
|
||||
}
|
||||
}
|
||||
testBlock.setType(REVERT_MATERIAL);
|
||||
|
||||
TempBlock tblock = new TempBlock(testBlock, REVERT_MATERIAL, testBlock.getData());
|
||||
affectedBlocks.add(tblock);
|
||||
totalBlocks2.add(tblock);
|
||||
|
||||
}
|
||||
|
||||
|
@ -393,6 +398,11 @@ public class LavaFlow
|
|||
affectedBlocks.remove(tblock);
|
||||
totalBlocks.remove(tblock);
|
||||
}
|
||||
if(totalBlocks2.contains(tblock))
|
||||
{
|
||||
affectedBlocks.remove(tblock);
|
||||
totalBlocks2.remove(tblock);
|
||||
}
|
||||
}
|
||||
for(BukkitRunnable task : tasks)
|
||||
task.cancel();
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.projectkorra.ProjectKorra.Flight;
|
|||
import com.projectkorra.ProjectKorra.Methods;
|
||||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||
import com.projectkorra.ProjectKorra.TempBlock;
|
||||
import com.projectkorra.ProjectKorra.Utilities.ParticleEffect;
|
||||
import com.projectkorra.ProjectKorra.chiblocking.Paralyze;
|
||||
|
||||
public class WaterSpout {
|
||||
|
@ -32,7 +33,10 @@ public class WaterSpout {
|
|||
private Block base;
|
||||
private TempBlock baseblock;
|
||||
private int defaultheight = HEIGHT;
|
||||
|
||||
private long time = 0;
|
||||
private long interval = 50;
|
||||
private int angle = 0;
|
||||
|
||||
public WaterSpout(Player player) {
|
||||
// if (BendingPlayer.getBendingPlayer(player).isOnCooldown(
|
||||
// Abilities.WaterSpout))
|
||||
|
@ -150,6 +154,7 @@ public class WaterSpout {
|
|||
if (!affectedblocks.containsKey(block)) {
|
||||
affectedblocks.put(block, block);
|
||||
}
|
||||
instances.get(player).rotateParticles(block);
|
||||
newaffectedblocks.put(block, block);
|
||||
}
|
||||
if (player.getLocation().getBlockY() > block.getY()) {
|
||||
|
@ -164,6 +169,41 @@ public class WaterSpout {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void rotateParticles(Block block)
|
||||
{
|
||||
if (System.currentTimeMillis() >= time + interval)
|
||||
{
|
||||
time = System.currentTimeMillis();
|
||||
|
||||
Location location = block.getLocation();
|
||||
Location playerloc = player.getLocation();
|
||||
location = new Location(location.getWorld(), playerloc.getX(), location.getY(), playerloc.getZ());
|
||||
|
||||
double dy = playerloc.getY() - block.getY();
|
||||
if (dy > HEIGHT)
|
||||
dy = HEIGHT;
|
||||
float[] directions = { -0.5f, 0.325f, 0.25f, 0.125f, 0.f, 0.125f, 0.25f, 0.325f, 0.5f };
|
||||
int index = angle;
|
||||
|
||||
angle++;
|
||||
if (angle >= directions.length)
|
||||
angle = 0;
|
||||
for (int i = 1; i <= dy; i++)
|
||||
{
|
||||
|
||||
index += 1;
|
||||
if (index >= directions.length)
|
||||
index = 0;
|
||||
|
||||
Location effectloc2 = new Location(location.getWorld(), location.getX(), block.getY() + i,
|
||||
location.getZ());
|
||||
|
||||
ParticleEffect.WATER_SPLASH.display(effectloc2, directions[index], directions[index],
|
||||
directions[index], 5, HEIGHT + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int spoutableWaterHeight(Location location, Player player) {
|
||||
WaterSpout spout = instances.get(player);
|
||||
|
|
Loading…
Reference in a new issue