mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Fixes Snow Regen and Adds Ignite option to FireBurst (#534)
Ignite determines whether FireBurst creates fire blocks in the world
This commit is contained in:
parent
a554c748d6
commit
8a7b372445
12 changed files with 20 additions and 11 deletions
|
@ -99,6 +99,10 @@ public abstract class ElementalAbility extends CoreAbility {
|
|||
return material == Material.LAVA || material == Material.STATIONARY_LAVA;
|
||||
}
|
||||
|
||||
public static boolean isSnow(Block block) {
|
||||
return block != null ? isSnow(block.getType()) : false;
|
||||
}
|
||||
|
||||
public static boolean isSnow(Material material) {
|
||||
return getConfig().getStringList("Properties.Water.SnowBlocks").contains(material.toString());
|
||||
}
|
||||
|
|
|
@ -986,6 +986,7 @@ public class ConfigManager {
|
|||
|
||||
config.addDefault("Abilities.Fire.FireBurst.Enabled", true);
|
||||
config.addDefault("Abilities.Fire.FireBurst.Damage", 2);
|
||||
config.addDefault("Abilities.Fire.FireBurst.Ignite", true);
|
||||
config.addDefault("Abilities.Fire.FireBurst.ChargeTime", 3500);
|
||||
config.addDefault("Abilities.Fire.FireBurst.Cooldown", 0);
|
||||
config.addDefault("Abilities.Fire.FireBurst.Range", 14);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class BlazeArc extends FireAbility {
|
|||
private void ignite(Block block) {
|
||||
if (block.getType() != Material.FIRE && block.getType() != Material.AIR) {
|
||||
if (canFireGrief()) {
|
||||
if (isPlant(block)) {
|
||||
if (isPlant(block) || isSnow(block)) {
|
||||
new PlantRegrowth(player, block);
|
||||
}
|
||||
} else if (block.getType() != Material.FIRE) {
|
||||
|
|
|
@ -35,6 +35,7 @@ public class FireBlast extends FireAbility {
|
|||
private boolean showParticles;
|
||||
private boolean dissipate;
|
||||
private boolean isFireBurst = false;
|
||||
private boolean fireBurstIgnite;
|
||||
private int ticks;
|
||||
private long cooldown;
|
||||
private double speedFactor;
|
||||
|
@ -97,6 +98,7 @@ public class FireBlast extends FireAbility {
|
|||
this.isFireBurst = true;
|
||||
this.powerFurnace = true;
|
||||
this.showParticles = true;
|
||||
this.fireBurstIgnite = getConfig().getBoolean("Abilities.Fire.FireBurst.Ignite");
|
||||
this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate");
|
||||
this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Cooldown");
|
||||
this.range = getConfig().getDouble("Abilities.Fire.FireBlast.Range");
|
||||
|
@ -141,7 +143,7 @@ public class FireBlast extends FireAbility {
|
|||
&& !safeBlocks.contains(block)
|
||||
&& !GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation())) {
|
||||
if (canFireGrief()) {
|
||||
if (WaterAbility.isPlantbendable(player, block.getType(), false)) {
|
||||
if (isPlant(block) || isSnow(block)) {
|
||||
new PlantRegrowth(player, block);
|
||||
}
|
||||
block.setType(Material.FIRE);
|
||||
|
@ -181,8 +183,10 @@ public class FireBlast extends FireAbility {
|
|||
furnace.setCookTime((short) 800);
|
||||
furnace.update();
|
||||
} else if (BlazeArc.isIgnitable(player, block.getRelative(BlockFace.UP))) {
|
||||
if((isFireBurst && fireBurstIgnite) || !isFireBurst) {
|
||||
ignite(location);
|
||||
}
|
||||
}
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ public class IceSpikeBlast extends IceAbility {
|
|||
settingUp = true;
|
||||
prepared = false;
|
||||
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
sourceBlock.setType(Material.AIR);
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public class OctopusForm extends WaterAbility {
|
|||
|
||||
private void form() {
|
||||
incrementStep();
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
sourceBlock.setType(Material.AIR);
|
||||
} else if (!GeneralMethods.isAdjacentToThreeOrMoreSources(sourceBlock)) {
|
||||
|
|
|
@ -173,7 +173,7 @@ public class SurgeWall extends WaterAbility {
|
|||
firstDirection = getDirection(sourceBlock.getLocation(), firstDestination);
|
||||
targetDirection = getDirection(firstDestination, targetDestination);
|
||||
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
}
|
||||
if (!GeneralMethods.isAdjacentToThreeOrMoreSources(sourceBlock)) {
|
||||
|
|
|
@ -204,7 +204,7 @@ public class SurgeWave extends WaterAbility {
|
|||
targetDirection = getDirection(sourceBlock.getLocation(), targetDestination).normalize();
|
||||
targetDestination = location.clone().add(targetDirection.clone().multiply(range));
|
||||
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
}
|
||||
if (!GeneralMethods.isAdjacentToThreeOrMoreSources(sourceBlock)) {
|
||||
|
|
|
@ -142,7 +142,7 @@ public class Torrent extends WaterAbility {
|
|||
sourceSelected = false;
|
||||
settingUp = true;
|
||||
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
sourceBlock.setType(Material.AIR);
|
||||
} else if (!GeneralMethods.isAdjacentToThreeOrMoreSources(sourceBlock)) {
|
||||
|
|
|
@ -147,7 +147,7 @@ public class WaterArms extends WaterAbility {
|
|||
private boolean prepare() {
|
||||
Block sourceBlock = getWaterSourceBlock(player, sourceGrabRange, canUsePlantSource);
|
||||
if (sourceBlock != null) {
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
fullSource = false;
|
||||
}
|
||||
ParticleEffect.LARGE_SMOKE.display(getWaterSourceBlock(player, sourceGrabRange, canUsePlantSource).getLocation().clone().add(0.5, 0.5, 0.5), 0, 0, 0, 0F, 4);
|
||||
|
|
|
@ -152,7 +152,7 @@ public class WaterManipulation extends WaterAbility {
|
|||
targetDestination = GeneralMethods.getPointOnLine(firstDestination, targetDestination, range);
|
||||
targetDirection = GeneralMethods.getDirection(firstDestination, targetDestination).normalize();
|
||||
|
||||
if (isPlant(sourceBlock)) {
|
||||
if (isPlant(sourceBlock) || isSnow(sourceBlock)) {
|
||||
new PlantRegrowth(player, sourceBlock);
|
||||
sourceBlock.setType(Material.AIR);
|
||||
} else if (!isIce(sourceBlock)) {
|
||||
|
|
|
@ -174,7 +174,7 @@ public class WaterSpoutWave extends WaterAbility {
|
|||
animation = AnimateState.RISE;
|
||||
location = origin.clone();
|
||||
|
||||
if (isPlant(origin.getBlock())) {
|
||||
if (isPlant(origin.getBlock()) || isSnow(origin.getBlock())) {
|
||||
new PlantRegrowth(player, origin.getBlock());
|
||||
origin.getBlock().setType(Material.AIR);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue