It should compile now + update FAWE api

This commit is contained in:
Telesphoreo 2022-03-30 23:43:38 -05:00
parent a39e101776
commit cf1b12cd9a
5 changed files with 61 additions and 53 deletions

View file

@ -17,7 +17,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
@ -125,13 +125,13 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.0.0-SNAPSHOT</version>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.0-SNAPSHOT</version>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -141,11 +141,25 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.boydti</groupId>
<artifactId>fawe-api</artifactId>
<version>18.07.27-3ed2e57-1163-20.5.2</version>
<groupId>com.fastasyncworldedit</groupId>
<artifactId>FastAsyncWorldEdit-Core</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
<!-- FAWE Bukkit API -->
<dependency>
<groupId>com.fastasyncworldedit</groupId>
<artifactId>FastAsyncWorldEdit-Bukkit</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>FastAsyncWorldEdit-Core</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>

View file

@ -1,8 +1,11 @@
package net.goldtreeservers.worldguardextraflags.fawe;
import com.fastasyncworldedit.core.regions.FaweMask;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
import com.sk89q.worldedit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.boydti.fawe.FaweAPI;
import com.fastasyncworldedit.core.FaweAPI;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@ -13,9 +16,16 @@ public class FAWEHelper
{
@Getter private final WorldGuardExtraFlagsPlugin plugin;
@Getter private final Plugin fawePlugin;
public void onEnable()
{
FaweAPI.addMaskManager(new FaweWorldEditFlagMaskManager(this.plugin));
FaweAPI.addMaskManager(new FaweMaskManager("WorldGuardExtraFlags")
{
@Override
public FaweMask getMask(Player player, MaskType type, boolean isWhitelist)
{
return null;
}
});
}
}

View file

@ -1,11 +1,10 @@
package net.goldtreeservers.worldguardextraflags.fawe;
import com.fastasyncworldedit.core.regions.FaweMask;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import com.boydti.fawe.object.FawePlayer;
import com.boydti.fawe.regions.FaweMask;
import com.boydti.fawe.regions.FaweMaskManager;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.flags.StateFlag.State;
@ -15,7 +14,7 @@ import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
import net.goldtreeservers.worldguardextraflags.flags.Flags;
import net.goldtreeservers.worldguardextraflags.wg.wrappers.AbstractRegionManagerWrapper;
public class FaweWorldEditFlagMaskManager extends FaweMaskManager<Player>
public class FaweWorldEditFlagMaskManager extends FaweMaskManager
{
private final WorldGuardExtraFlagsPlugin plugin;
@ -52,42 +51,9 @@ public class FaweWorldEditFlagMaskManager extends FaweMaskManager<Player>
return region.getFlag(Flags.WORLDEDIT) == State.DENY;
}
@Override
public FaweMask getMask(FawePlayer<Player> fawePlayer)
{
return null; //Problems here due to FaweMask using LocalWorld
/*final Player player = fawePlayer.parent;
final Location location = player.getLocation();
final ProtectedRegion myregion = this.getRegion(player, location);
if (myregion != null)
{
final BlockVector pos1;
final BlockVector pos2;
if (myregion.getId().equals("__global__"))
{
pos1 = new BlockVector(Integer.MIN_VALUE, 0, Integer.MIN_VALUE);
pos2 = new BlockVector(Integer.MAX_VALUE, 255, Integer.MAX_VALUE);
}
else
{
pos1 = new BlockVector(myregion.getMinimumPoint().getBlockX(), myregion.getMinimumPoint().getBlockY(), myregion.getMinimumPoint().getBlockZ());
pos2 = new BlockVector(myregion.getMaximumPoint().getBlockX(), myregion.getMaximumPoint().getBlockY(), myregion.getMaximumPoint().getBlockZ());
}
return new FaweMask(pos1, pos2)
{
@Override
public String getName()
{
return myregion.getId();
}
};
}
else
{
return null;
}*/
}
@Override
public FaweMask getMask(com.sk89q.worldedit.entity.Player player, MaskType type, boolean isWhitelist)
{
return null;
}
}

View file

@ -52,6 +52,24 @@
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit.worldedit-libs</groupId>
<artifactId>core</artifactId>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit.worldedit-libs</groupId>
<artifactId>bukkit</artifactId>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.intake</groupId>
<artifactId>intake</artifactId>
<version>4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-core</artifactId>

View file

@ -15,8 +15,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>