Merge branch 'development' into FS-37

This commit is contained in:
Ryan 2021-09-04 01:07:55 +01:00 committed by GitHub
commit da82b27016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 125 deletions

View File

@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v2.2.0
uses: actions/setup-java@v2.3.0
with:
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28
java-version: 11

View File

@ -13,7 +13,7 @@ jobs:
# Java 11 Builds
- name: Set up JDK 11
uses: actions/setup-java@v2.2.0
uses: actions/setup-java@v2.3.0
with:
java-version: 11
distribution: 'adopt'

View File

@ -13,7 +13,7 @@ jobs:
# Java 16 Builds
- name: Set up JDK 16
uses: actions/setup-java@v2.2.0
uses: actions/setup-java@v2.3.0
with:
java-version: 16
distribution: 'adopt'

36
pom.xml
View File

@ -39,9 +39,10 @@
</scm>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<id>totalfreedom-development</id>
<url>https://atlasmedia.jfrog.io/artifactory/totalfreedom-development/</url>
</repository>
<repository>
@ -101,19 +102,11 @@
</repository>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<id>esentialsx-repo</id>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
<repository>
<id>ess-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
</repository>
<repository>
<id>total-freedom-libs-snapshot-local</id>
<url>https://atlasmedia.jfrog.io/artifactory/total-freedom-libs-snapshot-local/</url>
</repository>
</repositories>
<dependencies>
@ -176,14 +169,7 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.3.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.18.2</version>
<version>7.2.4</version>
<scope>provided</scope>
</dependency>
@ -223,10 +209,10 @@
</dependency>
<dependency>
<groupId>net.goldtreeservers</groupId>
<artifactId>worldguardextraflags</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
<groupId>net.ess3</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.18.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -263,12 +249,14 @@
<version>3.1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.4.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>

View File

@ -1,96 +0,0 @@
package me.totalfreedom.totalfreedommod.command;
import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldguard.domains.DefaultDomain;
import com.sk89q.worldguard.protection.flags.Flag;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.flags.RegionGroup;
import com.sk89q.worldguard.protection.flags.StateFlag;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import java.util.HashMap;
import java.util.Map;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Make a WorldGuard region for an OP.", usage = "/<command> <playername> <name>", aliases = "mor")
public class Command_makeopregion extends FreedomCommand
{
final Map<Flag<?>, Object> flags = new HashMap<Flag<?>, Object>()
{{
put(Flags.BLOCK_PLACE, StateFlag.State.ALLOW);
put(Flags.BLOCK_BREAK, StateFlag.State.ALLOW);
put(Flags.BUILD, StateFlag.State.ALLOW);
put(Flags.PLACE_VEHICLE, StateFlag.State.ALLOW);
put(Flags.DESTROY_VEHICLE, StateFlag.State.ALLOW);
put(Flags.ENTITY_ITEM_FRAME_DESTROY, StateFlag.State.ALLOW);
put(Flags.ENTITY_PAINTING_DESTROY, StateFlag.State.ALLOW);
put(net.goldtreeservers.worldguardextraflags.flags.Flags.WORLDEDIT, StateFlag.State.ALLOW);
}};
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
{
if (args.length < 2)
{
return false;
}
final Player player = getPlayer(args[0]);
if (player == null)
{
msg(FreedomCommand.PLAYER_NOT_FOUND);
return true;
}
String name = args[1];
LocalSession session = plugin.web.getWorldEditPlugin().getSession(playerSender);
Region selection;
try
{
selection = session.getSelection(session.getSelectionWorld());
}
catch (IncompleteRegionException e)
{
msg("Please make a WorldEdit selection", ChatColor.RED);
return true;
}
if (selection == null)
{
msg("Please make a WorldEdit selection", ChatColor.RED);
return true;
}
ProtectedRegion region = new ProtectedCuboidRegion(name, selection.getMinimumPoint(), selection.getMaximumPoint());
DefaultDomain owners = new DefaultDomain();
owners.addPlayer(playerSender.getName());
owners.addPlayer(player.getName());
region.setOwners(owners);
region.setFlags(flags);
for (Flag<?> flag : flags.keySet())
{
region.setFlag(flag.getRegionGroupFlag(), RegionGroup.MEMBERS);
}
RegionManager regionManager = plugin.wgb.getRegionManager(playerSender.getWorld());
regionManager.addRegion(region);
msg("Successfully created the region '" + name + "' for " + player.getName(), ChatColor.GREEN);
return true;
}
}