mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2025-02-05 11:52:42 +00:00
Fixed nether-portals flag on 1.14
This needs clean up later...
This commit is contained in:
parent
be129516c7
commit
78add0a96f
19 changed files with 201 additions and 69 deletions
|
@ -14,43 +14,14 @@
|
|||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.sk89q.com/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>empcraft</id>
|
||||
<url>http://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dmulloy2-repo</id>
|
||||
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg6</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg7</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -59,35 +30,5 @@
|
|||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-legacy</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>Essentials</artifactId>
|
||||
<version>2.13-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.boydti</groupId>
|
||||
<artifactId>fawe-api</artifactId>
|
||||
<version>18.07.27-3ed2e57-1163-20.5.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib-API</artifactId>
|
||||
<version>4.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
74
Spigot-1_14/pom.xml
Normal file
74
Spigot-1_14/pom.xml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<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>
|
||||
<parent>
|
||||
<groupId>net.goldtreeservers</groupId>
|
||||
<artifactId>worldguardextraflags</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</parent>
|
||||
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>spigot-1_14</artifactId>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.sk89q.com/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>empcraft</id>
|
||||
<url>http://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dmulloy2-repo</id>
|
||||
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg6</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>wg7</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-legacy</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,34 @@
|
|||
package net.goldtreeservers.worldguardextraflags.spigot1_14;
|
||||
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.world.PortalCreateEvent;
|
||||
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.goldtreeservers.worldguardextraflags.AbstractWorldGuardExtraFlagsPlugin;
|
||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class EntityListener implements Listener
|
||||
{
|
||||
@Getter private final AbstractWorldGuardExtraFlagsPlugin plugin;
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPortalCreateEvent(PortalCreateEvent event)
|
||||
{
|
||||
for(BlockState block : event.getBlocks())
|
||||
{
|
||||
ApplicableRegionSet regions = this.plugin.getWorldGuardCommunicator().getRegionContainer().createQuery().getApplicableRegions(block.getLocation());
|
||||
if (regions.queryValue(null, Flags.NETHER_PORTALS) == State.DENY)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -40,7 +40,28 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.sk89q.com/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>empcraft</id>
|
||||
<url>http://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dmulloy2-repo</id>
|
||||
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -67,5 +88,48 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers.worldguardextraflags</groupId>
|
||||
<artifactId>spigot-1_14</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-legacy</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>Essentials</artifactId>
|
||||
<version>2.13-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.boydti</groupId>
|
||||
<artifactId>fawe-api</artifactId>
|
||||
<version>18.07.27-3ed2e57-1163-20.5.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib-API</artifactId>
|
||||
<version>4.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,9 +1,12 @@
|
|||
package net.goldtreeservers.worldguardextraflags;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.event.entity.EntityToggleGlideEvent;
|
||||
import org.bukkit.event.world.PortalCreateEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
@ -25,15 +28,13 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.WorldGuardCommunicat
|
|||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v6.WorldGuardSixCommunicator;
|
||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v7.WorldGuardSevenCommunicator;
|
||||
|
||||
public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
||||
public class WorldGuardExtraFlagsPlugin extends AbstractWorldGuardExtraFlagsPlugin
|
||||
{
|
||||
@Getter private static WorldGuardExtraFlagsPlugin plugin;
|
||||
|
||||
@Getter private WorldGuardPlugin worldGuardPlugin;
|
||||
@Getter private WorldEditPlugin worldEditPlugin;
|
||||
|
||||
@Getter private WorldGuardCommunicator worldGuardCommunicator;
|
||||
|
||||
@Getter private EssentialsHelper essentialsHelper;
|
||||
@Getter private FAWEHelper faweHelper;
|
||||
@Getter private ProtocolLibHelper protocolLibHelper;
|
||||
|
@ -132,7 +133,6 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
|||
|
||||
this.getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
|
||||
this.getServer().getPluginManager().registerEvents(new BlockListener(this), this);
|
||||
this.getServer().getPluginManager().registerEvents(new EntityListener(this), this);
|
||||
this.getServer().getPluginManager().registerEvents(new WorldListener(this), this);
|
||||
|
||||
try
|
||||
|
@ -147,6 +147,24 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
|||
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ParameterizedType type = (ParameterizedType)PortalCreateEvent.class.getDeclaredField("blocks").getGenericType();
|
||||
Class<?> clazz = (Class<?>)type.getActualTypeArguments()[0];
|
||||
if (clazz == BlockState.class)
|
||||
{
|
||||
this.getServer().getPluginManager().registerEvents(new net.goldtreeservers.worldguardextraflags.spigot1_14.EntityListener(this), this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.getServer().getPluginManager().registerEvents(new EntityListener(this), this);
|
||||
}
|
||||
}
|
||||
catch(Throwable ignored)
|
||||
{
|
||||
this.getServer().getPluginManager().registerEvents(new EntityListener(this), this);
|
||||
}
|
||||
|
||||
if (this.faweHelper != null)
|
||||
{
|
||||
this.faweHelper.onEnable();
|
1
pom.xml
1
pom.xml
|
@ -37,5 +37,6 @@
|
|||
<module>WG</module>
|
||||
<module>WG7</module>
|
||||
<module>Spigot</module>
|
||||
<module>Spigot-1_14</module>
|
||||
</modules>
|
||||
</project>
|
Loading…
Reference in a new issue