Merge pull request #3 from PhanaticD/wip-1.13

Some more 1.13 updates/fixes
This commit is contained in:
Simplicitee 2019-01-01 14:56:43 -05:00 committed by GitHub
commit 8415745eed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 330 additions and 176 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

79
pom.xml
View file

@ -1,12 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.projectkorra</groupId>
<artifactId>projectkorra</artifactId>
<version>1.8.7</version>
<name>ProjectKorra</name>
<repositories>
<!-- WorldGuard and WorldEdit Repo -->
<repository>
@ -23,16 +21,31 @@
<id>md_5-snapshots</id>
<url>https://repo.md-5.net/content/repositories/snapshots/</url>
</repository>
<!-- Spigot Repo -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- Bentobox Repo -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<!-- Spigot Server (run BuildTools locally) -->
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<artifactId>spigot-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<!-- Factions -->
<dependency>
<groupId>me.markeh</groupId>
@ -64,14 +77,14 @@
<scope>provided</scope>
</dependency>
<!-- PreciousStones -->
<!-- outdated
<dependency>
<groupId>net.sacredlabyrinth.Phaed</groupId>
<artifactId>PreciousStones</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PreciousStones 10.6.1.jar</systemPath>
</dependency>
<!-- outdated
<dependency>
<groupId>net.sacredlabyrinth.Phaed</groupId>
<artifactId>PreciousStones</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PreciousStones 10.6.1.jar</systemPath>
</dependency>
-->
<!-- Residence -->
<dependency>
@ -89,6 +102,7 @@
<scope>system</scope>
<systemPath>${project.basedir}/lib/Towny.jar</systemPath>
</dependency>
<!-- WorldEdit / WorldGuard -->
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
@ -113,16 +127,38 @@
<version>7.0.0-beta-02</version>
<scope>provided</scope>
</dependency>
<!-- Kingdoms -->
<!-- SkyBlock / AcidIsland -->
<dependency>
<groupId>org.kingdoms</groupId>
<artifactId>Kingdoms</artifactId>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
<!-- RedProtect -->
<dependency>
<groupId>br.net.fabiozumbi12</groupId>
<artifactId>RedProtect</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Kingdoms.jar</systemPath>
<systemPath>${project.basedir}/lib/RedProtect-7.5.5-b129-Universal.jar</systemPath>
</dependency>
<!-- PlotSquared -->
<dependency>
<groupId>com.github.intelletualsites</groupId>
<artifactId>plotsquared</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PlotSquared-Bukkit-4.18.12.31-38a382f-2131.jar</systemPath>
</dependency>
<!-- Kingdoms -->
<dependency>
<groupId>com.songoda</groupId>
<artifactId>kingdoms</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/FabledKingdoms-1.2.3.jar</systemPath>
</dependency>
</dependencies>
<build>
<defaultGoal>clean package install</defaultGoal>
<finalName>${project.name}-${project.version}</finalName>
@ -149,8 +185,7 @@
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
</project>

View file

@ -1,9 +1,19 @@
package com.projectkorra.projectkorra;
import br.net.fabiozumbi12.RedProtect.Bukkit.API.RedProtectAPI;
import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect;
import br.net.fabiozumbi12.RedProtect.Bukkit.Region;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.api.ResidenceInterface;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import com.bekvon.bukkit.residence.protection.ResidencePermissions;
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
import com.github.intellectualsites.plotsquared.plot.config.C;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.google.common.reflect.ClassPath;
import com.griefcraft.lwc.LWC;
import com.griefcraft.lwc.LWCPlugin;
@ -40,6 +50,10 @@ 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.songoda.kingdoms.constants.land.Land;
import com.songoda.kingdoms.constants.land.SimpleChunkLocation;
import com.songoda.kingdoms.constants.player.KingdomPlayer;
import com.songoda.kingdoms.manager.game.GameManagement;
import me.markeh.factionsframework.entities.FPlayer;
import me.markeh.factionsframework.entities.FPlayers;
import me.markeh.factionsframework.entities.Faction;
@ -65,13 +79,9 @@ import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import org.kingdoms.constants.StructureType;
import org.kingdoms.constants.kingdom.Kingdom;
import org.kingdoms.constants.land.Land;
import org.kingdoms.constants.land.SimpleChunkLocation;
import org.kingdoms.constants.land.SimpleLocation;
import org.kingdoms.constants.player.KingdomPlayer;
import org.kingdoms.manager.game.GameManagement;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import java.io.*;
import java.lang.reflect.Field;
@ -1338,6 +1348,9 @@ public class GeneralMethods {
final boolean respectLWC = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RespectLWC");
final boolean respectResidence = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.Residence.Respect");
final boolean respectKingdoms = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.Kingdoms");
final boolean respectPlotSquared = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.PlotSquared");
final boolean respectRedProtect = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RedProtect");
final boolean respectBentoBox = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.BentoBox");
boolean isIgnite = false;
boolean isExplosive = false;
@ -1366,6 +1379,9 @@ public class GeneralMethods {
final Plugin lwc = pm.getPlugin("LWC");
final Plugin residence = pm.getPlugin("Residence");
final Plugin kingdoms = pm.getPlugin("Kingdoms");
final Plugin plotsquared = pm.getPlugin("PlotSquared");
final Plugin redprotect = pm.getPlugin("RedProtect");
final Plugin bentobox = pm.getPlugin("BentoBox");
for (final Location location : new Location[] { loc, player.getLocation() }) {
final World world = location.getWorld();
@ -1502,33 +1518,80 @@ public class GeneralMethods {
}
if (kingdoms != null && respectKingdoms) {
final SimpleLocation location_ = new SimpleLocation(loc);
final SimpleChunkLocation chunk = location_.toSimpleChunk();
final Land land = GameManagement.getLandManager().getOrLoadLand(chunk);
if (land.getOwner() != null) {
final KingdomPlayer kp = GameManagement.getPlayerManager().getSession(player);
if (!kp.isAdminMode()) {
if (land.getOwner().equals("SafeZone")) {
KingdomPlayer kPlayer = GameManagement.getPlayerManager().getOfflineKingdomPlayer(player).getKingdomPlayer();
if (kPlayer.getKingdom() != null) {
SimpleChunkLocation chunkLocation = new SimpleChunkLocation(location.getChunk());
Land land = GameManagement.getLandManager().getOrLoadLand(chunkLocation);
String owner = land.getOwner();
if (owner != null) {
if (!kPlayer.getKingdom().getKingdomName().equals(owner)) {
return true;
} else if (kp.getKingdom() == null) { // If the player isn't in a kingdom but it's claimed land.
return true;
} else {
final Kingdom kingdom = kp.getKingdom();
final String kingdomName = kingdom.getKingdomName();
if (!kingdomName.equals(land.getOwner())) // If the player's kingdom doesn't match.
{
}
}
}
}
if (plotsquared != null && respectPlotSquared) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation = BukkitUtil.getLocation(location);
PlotArea plotArea = plotLocation.getPlotArea();
if (plotArea != null) {
Plot plot = plotArea.getPlot(plotLocation);
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
if (plot != null) {
if (location.getBlock().getY() == 0) {
if (!Permissions.hasPermission(plotPlayer, C.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
return true;
}
// If it's within the nexus area, test for higher permission.
if (land.getStructure() != null && land.getStructure().getType() == StructureType.NEXUS) {
if (!kp.getRank().isHigherOrEqualTo(kingdom.getPermissionsInfo().getBuildInNexus())) {
return true;
}
} else if ((location.getY() > plotArea.MAX_BUILD_HEIGHT || location.getY() < plotArea.MIN_BUILD_HEIGHT) && !Permissions
.hasPermission(plotPlayer, C.PERMISSION_ADMIN_BUILD_HEIGHTLIMIT)) {
return true;
}
if (!plot.hasOwner()) {
if (!Permissions.hasPermission(plotPlayer, C.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
return true;
}
}
if (!plot.isAdded(plotPlayer.getUUID())) {
if (!Permissions.hasPermission(plotPlayer, C.PERMISSION_ADMIN_DESTROY_OTHER)) {
return true;
}
} else if (Settings.Done.RESTRICT_BUILDING && plot.getFlags().containsKey(com.github.intellectualsites.plotsquared.plot.flag.Flags.DONE)) {
if (!Permissions.hasPermission(plotPlayer, C.PERMISSION_ADMIN_BUILD_OTHER)) {
return true;
}
}
}
if (!Permissions.hasPermission(plotPlayer, C.PERMISSION_ADMIN_DESTROY_ROAD)) {
return true;
}
}
}
if (redprotect != null && respectRedProtect) {
RedProtectAPI api = RedProtect.get().getAPI();
Region region = api.getRegion(location);
if (!(region != null && region.canBuild(player))) {
return true;
}
}
if (bentobox != null && respectBentoBox) {
BentoBox bentoBoxPlugin = BentoBox.getInstance();
if (bentoBoxPlugin.getIWM().inWorld(loc)) {
Optional<Island> island = bentoBoxPlugin.getIslands().getProtectedIslandAt(loc);
if (!(player.isOp() || player.hasPermission(bentoBoxPlugin.getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypass.BREAK_BLOCKS.everywhere"))){
if (island.isPresent()) {
if (!island.get().isAllowed(User.getInstance(player), bentoBoxPlugin.getFlagsManager().getFlagByID("BREAK_BLOCKS"))) {
return true;
}
if (!(player.hasPermission(bentoBoxPlugin.getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypass.BREAK_BLOCKS.island"))) {
return true;
}
}
if (!bentoBoxPlugin.getFlagsManager().getFlagByID("BREAK_BLOCKS").isSetForWorld(loc.getWorld())) {
return true;
}
}
}
}
@ -1786,15 +1849,24 @@ public class GeneralMethods {
final boolean respectTowny = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RespectTowny");
final boolean respectGriefPrevention = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RespectGriefPrevention");
final boolean respectLWC = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RespectLWC");
final boolean respectResidence = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.Residence.Respect");
final boolean respectKingdoms = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.Kingdoms");
final boolean respectPlotSquared = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.PlotSquared");
final boolean respectRedProtect = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.RedProtect");
final boolean respectBentoBox = ConfigManager.defaultConfig.get().getBoolean("Properties.RegionProtection.BentoBox");
final PluginManager pm = Bukkit.getPluginManager();
final Plugin wgp = pm.getPlugin("WorldGuard");
final Plugin psp = pm.getPlugin("PreciousStones");
final Plugin fcp = pm.getPlugin("Factions");
final Plugin fcp = pm.getPlugin("FactionsFramework");
final Plugin twnp = pm.getPlugin("Towny");
final Plugin gpp = pm.getPlugin("GriefPrevention");
final Plugin massivecore = pm.getPlugin("MassiveCore");
final Plugin lwc = pm.getPlugin("LWC");
final Plugin residence = pm.getPlugin("Residence");
final Plugin kingdoms = pm.getPlugin("Kingdoms");
final Plugin plotsquared = pm.getPlugin("PlotSquared");
final Plugin redprotect = pm.getPlugin("RedProtect");
final Plugin bentobox = pm.getPlugin("BentoBox");
if (wgp != null && respectWorldGuard) {
writeToDebug("WorldGuard v" + wgp.getDescription().getVersion());
@ -1803,10 +1875,7 @@ public class GeneralMethods {
writeToDebug("PreciousStones v" + psp.getDescription().getVersion());
}
if (fcp != null && respectFactions) {
writeToDebug("Factions v" + fcp.getDescription().getVersion());
}
if (massivecore != null && respectFactions) {
writeToDebug("MassiveCore v" + massivecore.getDescription().getVersion());
writeToDebug("FactionsFramework v" + fcp.getDescription().getVersion());
}
if (twnp != null && respectTowny) {
writeToDebug("Towny v" + twnp.getDescription().getVersion());
@ -1817,6 +1886,21 @@ public class GeneralMethods {
if (lwc != null && respectLWC) {
writeToDebug("LWC v" + lwc.getDescription().getVersion());
}
if (residence != null && respectResidence) {
writeToDebug("Residence v" + residence.getDescription().getVersion());
}
if (kingdoms != null && respectKingdoms) {
writeToDebug("Kingdoms v" + kingdoms.getDescription().getVersion());
}
if (plotsquared != null && respectPlotSquared) {
writeToDebug("PlotSquared v" + plotsquared.getDescription().getVersion());
}
if (redprotect != null && respectRedProtect) {
writeToDebug("RedProtect v" + redprotect.getDescription().getVersion());
}
if (bentobox != null && respectBentoBox) {
writeToDebug("BentoBox v" + bentobox.getDescription().getVersion());
}
writeToDebug("");
writeToDebug("Plugins Hooking Into ProjectKorra (Core)");

View file

@ -1,11 +1,16 @@
package com.projectkorra.projectkorra.airbending;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.earthbending.lava.LavaFlow;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -22,17 +27,11 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.earthbending.lava.LavaFlow;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public class AirBlast extends AirAbility {
@ -426,6 +425,11 @@ public class AirBlast extends AirAbility {
}
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.radius)) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
this.affect(entity);
}

View file

@ -1,12 +1,14 @@
package com.projectkorra.projectkorra.airbending;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.waterbending.WaterSpout;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -18,15 +20,8 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.waterbending.WaterSpout;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
public class AirSuction extends AirAbility {
@ -246,6 +241,11 @@ public class AirSuction extends AirAbility {
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.radius)) {
if (entity.getEntityId() != this.player.getEntityId() || this.hasOtherOrigin) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
final Vector velocity = entity.getVelocity();
final double max = this.speed;
double factor = this.pushFactor;

View file

@ -1,15 +1,5 @@
package com.projectkorra.projectkorra.airbending.combo;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
@ -18,6 +8,15 @@ import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformatio
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.ClickType;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class AirStream extends AirAbility implements ComboAbility {
@ -160,6 +159,11 @@ public class AirStream extends AirAbility implements ComboAbility {
this.time = System.currentTimeMillis();
}
if (!entity.equals(this.player) && !this.affectedEntities.contains(entity)) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
this.affectedEntities.add(entity);
if (entity instanceof Player) {
final Player ep = (Player) entity;

View file

@ -1,11 +1,11 @@
package com.projectkorra.projectkorra.configuration;
import java.io.File;
import java.util.ArrayList;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import java.io.File;
import java.util.ArrayList;
public class ConfigManager {
public static Config presetConfig;
@ -566,6 +566,9 @@ public class ConfigManager {
config.addDefault("Properties.RegionProtection.Residence.Flag", "bending");
config.addDefault("Properties.RegionProtection.Residence.Respect", true);
config.addDefault("Properties.RegionProtection.Kingdoms", true);
config.addDefault("Properties.RegionProtection.PlotSquared", true);
config.addDefault("Properties.RegionProtection.RedProtect", true);
config.addDefault("Properties.RegionProtection.BentoBox", true);
config.addDefault("Properties.RegionProtection.CacheBlockTime", 5000);
config.addDefault("Properties.Air.CanBendWithWeapons", false);

View file

@ -1,9 +1,12 @@
package com.projectkorra.projectkorra.earthbending;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.DamageHandler;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -13,12 +16,9 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.DamageHandler;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class Ripple extends EarthAbility {
@ -274,6 +274,11 @@ public class Ripple extends EarthAbility {
}
private void affect(final Entity entity) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
return;
}
}
if (entity instanceof LivingEntity) {
DamageHandler.damageEntity(entity, this.damage, this);
}

View file

@ -1,11 +1,19 @@
package com.projectkorra.projectkorra.waterbending;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.firebending.FireBlast;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempBlock.RevertTask;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -15,19 +23,11 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.FireBlast;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempBlock.RevertTask;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public class SurgeWave extends WaterAbility {
@ -330,6 +330,11 @@ public class SurgeWave extends WaterAbility {
}
}
if (knockback) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
final Vector dir = direction.clone();
dir.setY(dir.getY() * this.knockup);
GeneralMethods.setVelocity(entity, entity.getVelocity().clone().add(dir.clone().multiply(this.getNightFactor(this.knockback))));

View file

@ -1,11 +1,15 @@
package com.projectkorra.projectkorra.waterbending;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.*;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -14,19 +18,11 @@ 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.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource;
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 com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public class Torrent extends WaterAbility {
@ -538,6 +534,11 @@ public class Torrent extends WaterAbility {
if (entity.getEntityId() == this.player.getEntityId()) {
return;
}
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
return;
}
}
double x, z, vx, vz, mag;
double angle = 50;
angle = Math.toRadians(angle);

View file

@ -1,11 +1,11 @@
package com.projectkorra.projectkorra.waterbending;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -13,11 +13,11 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public class TorrentWave extends WaterAbility {
@ -150,6 +150,11 @@ public class TorrentWave extends WaterAbility {
for (final Entity entity : indexList) {
if (!this.affectedEntities.contains(entity)) {
if (entity.getLocation().distanceSquared(location) <= 4) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
this.affectedEntities.add(entity);
this.affect(entity);
}

View file

@ -1,7 +1,13 @@
package com.projectkorra.projectkorra.waterbending.multiabilities;
import java.util.HashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
@ -12,14 +18,7 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
import java.util.HashMap;
public class WaterArmsWhip extends WaterAbility {
@ -294,8 +293,10 @@ public class WaterArmsWhip extends WaterAbility {
switch (this.ability) {
case PULL:
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2)) {
if (entity instanceof Player && Commands.invincible.contains(((Player) entity).getName())) {
continue;
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
final Vector vector = endOfArm.toVector().subtract(entity.getLocation().toVector());
entity.setVelocity(vector.multiply(this.pullMultiplier));
@ -303,8 +304,10 @@ public class WaterArmsWhip extends WaterAbility {
break;
case PUNCH:
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2)) {
if (entity instanceof Player && Commands.invincible.contains(((Player) entity).getName())) {
continue;
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
final Vector vector = entity.getLocation().toVector().subtract(endOfArm.toVector());
@ -324,6 +327,11 @@ public class WaterArmsWhip extends WaterAbility {
if (this.grabbedEntity == null) {
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2)) {
if (entity instanceof LivingEntity && entity.getEntityId() != this.player.getEntityId() && !GRABBED_ENTITIES.containsKey(entity)) {
if (entity instanceof Player) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || Commands.invincible.contains(((Player) entity).getName())){
continue;
}
}
GRABBED_ENTITIES.put((LivingEntity) entity, this);
this.grabbedEntity = (LivingEntity) entity;
this.grabbed = true;