mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
commit
3354d4d6ad
11 changed files with 31 additions and 11 deletions
|
@ -49,6 +49,10 @@ public class ConfigManager {
|
|||
config.addDefault("Properties.Chat.Colors.Chi", "GOLD");
|
||||
|
||||
config.addDefault("Properties.ImportEnabled", true);
|
||||
config.addDefault("Properties.BendingAffectFallingSand.Normal", true);
|
||||
config.addDefault("Properties.BendingAffectFallingSand.NormalStrengthMultiplier", 1.0);
|
||||
config.addDefault("Properties.BendingAffectFallingSand.TNT", true);
|
||||
config.addDefault("Properties.BendingAffectFallingSand.TNTStrengthMultiplier", 1.0);
|
||||
config.addDefault("Properties.GlobalCooldown", 500);
|
||||
config.addDefault("Properties.SeaLevel", 62);
|
||||
|
||||
|
|
|
@ -119,6 +119,8 @@ import com.sk89q.worldguard.protection.flags.DefaultFlag;
|
|||
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
|
||||
import org.bukkit.entity.FallingSand;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
|
||||
public class Methods {
|
||||
|
||||
|
@ -1885,6 +1887,20 @@ public class Methods {
|
|||
|
||||
EarthPassive.removeAll();
|
||||
}
|
||||
|
||||
public static void setVelocity(Entity entity, Vector velocity){
|
||||
if (entity instanceof TNTPrimed){
|
||||
if (plugin.getConfig().getBoolean("Properties.BendingAffectFallingSand.TNT"))
|
||||
entity.setVelocity(velocity.multiply(plugin.getConfig().getDouble("Properties.BendingAffectFallingSand.TNTStrengthMultiplier")));
|
||||
return;
|
||||
}
|
||||
if (entity instanceof FallingSand){
|
||||
if (plugin.getConfig().getBoolean("Properties.BendingAffectFallingSand.Normal"))
|
||||
entity.setVelocity(velocity.multiply(plugin.getConfig().getDouble("Properties.BendingAffectFallingSand.NormalStrengthMultiplier")));
|
||||
return;
|
||||
}
|
||||
entity.setVelocity(velocity);
|
||||
}
|
||||
|
||||
public static double waterbendingNightAugment(double value, World world) {
|
||||
if (isNight(world)) {
|
||||
|
|
|
@ -249,7 +249,7 @@ public class AirBlast {
|
|||
if (Commands.invincible.contains(((Player) entity).getName())) return;
|
||||
}
|
||||
|
||||
entity.setVelocity(velocity);
|
||||
Methods.setVelocity(entity, velocity);
|
||||
entity.setFallDistance(0);
|
||||
if (!isUser && entity instanceof Player) {
|
||||
new Flight((Player) entity, player);
|
||||
|
|
|
@ -92,7 +92,7 @@ public class AirShield {
|
|||
}
|
||||
|
||||
velocity.multiply(radius / maxradius);
|
||||
entity.setVelocity(velocity);
|
||||
Methods.setVelocity(entity, velocity);
|
||||
entity.setFallDistance(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ public class AirSuction {
|
|||
if (entity instanceof Player) {
|
||||
if (Commands.invincible.contains(((Player) entity).getName())) continue;
|
||||
}
|
||||
entity.setVelocity(velocity);
|
||||
Methods.setVelocity(entity, velocity);
|
||||
entity.setFallDistance(0);
|
||||
if (entity.getEntityId() != player.getEntityId()
|
||||
&& entity instanceof Player) {
|
||||
|
|
|
@ -247,9 +247,9 @@ public class AirSwipe {
|
|||
}
|
||||
if(surroundingEntities.size() < MAX_AFFECTABLE_ENTITIES){
|
||||
if (AvatarState.isAvatarState(player)) {
|
||||
entity.setVelocity(fDirection.multiply(AvatarState.getValue(pushfactor)));
|
||||
Methods.setVelocity(entity, fDirection.multiply(AvatarState.getValue(pushfactor)));
|
||||
} else {
|
||||
entity.setVelocity(fDirection.multiply(pushfactor));
|
||||
Methods.setVelocity(entity, fDirection.multiply(pushfactor));
|
||||
}
|
||||
}
|
||||
if (entity instanceof LivingEntity
|
||||
|
|
|
@ -157,7 +157,7 @@ public class Tornado {
|
|||
velocity.setZ(vz);
|
||||
velocity.setY(vy);
|
||||
velocity.multiply(timefactor);
|
||||
entity.setVelocity(velocity);
|
||||
Methods.setVelocity(entity, velocity);
|
||||
entity.setFallDistance(0);
|
||||
|
||||
Methods.breakBreathbendingHold(entity);
|
||||
|
|
|
@ -195,9 +195,9 @@ public class FireBlast {
|
|||
private void affect(Entity entity) {
|
||||
if (entity.getEntityId() != player.getEntityId()) {
|
||||
if (AvatarState.isAvatarState(player)) {
|
||||
entity.setVelocity(direction.clone().multiply(AvatarState.getValue(pushfactor)));
|
||||
Methods.setVelocity(entity, direction.clone().multiply(AvatarState.getValue(pushfactor)));
|
||||
} else {
|
||||
entity.setVelocity(direction.clone().multiply(pushfactor));
|
||||
Methods.setVelocity(entity, direction.clone().multiply(pushfactor));
|
||||
}
|
||||
if (entity instanceof LivingEntity) {
|
||||
entity.setFireTicks(50);
|
||||
|
|
|
@ -175,7 +175,7 @@ public class WallOfFire {
|
|||
|
||||
private void affect(Entity entity) {
|
||||
entity.setFireTicks(50);
|
||||
entity.setVelocity(new Vector(0, 0, 0));
|
||||
Methods.setVelocity(entity, new Vector(0, 0, 0));
|
||||
if (entity instanceof LivingEntity) {
|
||||
Methods.damageEntity(player, entity, damage);
|
||||
new Enflamed(entity, player);
|
||||
|
|
|
@ -498,7 +498,7 @@ public class Torrent {
|
|||
velocity.setZ(vec.getY());
|
||||
}
|
||||
|
||||
entity.setVelocity(velocity);
|
||||
Methods.setVelocity(entity, velocity);
|
||||
entity.setFallDistance(0);
|
||||
if (entity instanceof LivingEntity) {
|
||||
World world = player.getWorld();
|
||||
|
|
|
@ -295,7 +295,7 @@ public class Wave {
|
|||
if (knockback) {
|
||||
Vector dir = direction.clone();
|
||||
dir.setY(dir.getY() * upfactor);
|
||||
entity.setVelocity(entity.getVelocity().clone()
|
||||
Methods.setVelocity(entity, entity.getVelocity().clone()
|
||||
.add(dir.clone().multiply(Methods.waterbendingNightAugment(factor, player.getWorld()))));
|
||||
entity.setFallDistance(0);
|
||||
if (entity.getFireTicks() > 0)
|
||||
|
|
Loading…
Reference in a new issue