Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions Spigot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<pattern>org.bstats</pattern>
<shadedPattern>net.goldtreeservers.worldguardextraflags.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.Anon8281.universalScheduler</pattern>
<shadedPattern>net.goldtreeservers.worldguardextraflags.universalScheduler</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
Expand Down Expand Up @@ -65,6 +69,10 @@
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -76,9 +84,9 @@
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<groupId>dev.folia</groupId>
<artifactId>folia-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -117,5 +125,11 @@
<version>1.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.Anon8281</groupId>
<artifactId>UniversalScheduler</artifactId>
<version>0.1.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import com.sk89q.worldguard.session.SessionManager;
import io.papermc.lib.PaperLib;
import javafx.print.PaperSource;
import net.goldtreeservers.worldguardextraflags.flags.helpers.ForcedStateFlag;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
Expand Down Expand Up @@ -85,7 +87,10 @@ public void onEntityToggleGlideEvent(EntityToggleGlideEvent event)
event.setCancelled(true);

//Prevent the player from being allowed to glide by spamming space
player.teleport(player.getLocation());

//player.teleportAsync was added with paper, so it doesn't exist on spigot/bukkit
//PaperLib.teleport is the universal solution
PaperLib.teleportAsync(player, player.getLocation());

break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.goldtreeservers.worldguardextraflags.listeners;

import com.github.Anon8281.universalScheduler.UniversalRunnable;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldguard.LocalPlayer;
Expand All @@ -23,7 +24,6 @@
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.Potion;
import org.bukkit.scheduler.BukkitRunnable;
import org.spigotmc.event.player.PlayerSpawnLocationEvent;

import com.sk89q.worldguard.protection.ApplicableRegionSet;
Expand Down Expand Up @@ -150,7 +150,7 @@ public void onPlayerGameModeChangeEvent(PlayerGameModeChangeEvent event)
Boolean value = wgSession.getHandler(FlyFlagHandler.class).getCurrentValue();
if (value != null)
{
new BukkitRunnable()
new UniversalRunnable()
{
@Override
public void run()
Expand All @@ -162,7 +162,7 @@ public void run()
}
else
{
new BukkitRunnable()
new UniversalRunnable()
{
@Override
public void run()
Expand Down
4 changes: 4 additions & 0 deletions Spigot/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: WorldGuardExtraFlags
description: Adds more flags to WorldGuard to help manage your server easily!


folia-supported: true

version: 4.2.3-SNAPSHOT

api-version: 1.13

author: isokissa3
Expand Down
18 changes: 14 additions & 4 deletions WG/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<groupId>dev.folia</groupId>
<artifactId>folia-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -51,5 +55,11 @@
<version>7.0.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>com.github.Anon8281</groupId>
<artifactId>UniversalScheduler</artifactId>
<version>0.1.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.util.HashSet;
import java.util.Set;

import com.github.Anon8281.universalScheduler.UniversalRunnable;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

public class WorldGuardUtils
{
Expand All @@ -27,7 +27,7 @@ public static boolean hasNoTeleportLoop(Plugin plugin, Player player, Object loc

player.setMetadata(WorldGuardUtils.PREVENT_TELEPORT_LOOP_META, result);

new BukkitRunnable()
new UniversalRunnable()
{
@Override
public void run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import java.util.Map.Entry;
import java.util.Set;

import com.github.Anon8281.universalScheduler.UniversalRunnable;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.session.handler.FlagValueChangeHandler;
import com.sk89q.worldguard.session.handler.Handler;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.session.MoveType;
Expand Down Expand Up @@ -46,7 +46,7 @@ public PlaySoundsFlagHandler create(Session session)
}

private final Plugin plugin;
private Map<String, BukkitRunnable> runnables;
private final Map<String, UniversalRunnable> runnables;

protected PlaySoundsFlagHandler(Plugin plugin, Session session)
{
Expand Down Expand Up @@ -93,7 +93,7 @@ private void handleValue(LocalPlayer player, Set<SoundData> value)
{
if (!this.runnables.containsKey(sound.sound()))
{
BukkitRunnable runnable = new BukkitRunnable()
UniversalRunnable runnable = new UniversalRunnable()
{
@Override
public void run()
Expand All @@ -117,10 +117,10 @@ public void cancel()
}
}

Iterator<Entry<String, BukkitRunnable>> runnables = this.runnables.entrySet().iterator();
Iterator<Entry<String, UniversalRunnable>> runnables = this.runnables.entrySet().iterator();
while (runnables.hasNext())
{
Entry<String, BukkitRunnable> runnable = runnables.next();
Entry<String, UniversalRunnable> runnable = runnables.next();

if (value != null && value.size() > 0)
{
Expand Down