Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
b2215bf079
378
pom.xml
378
pom.xml
|
@ -1,190 +1,202 @@
|
||||||
<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">
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
<modelVersion>4.0.0</modelVersion>
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
<groupId>world.bentobox</groupId>
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>limits</artifactId>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<version>0.2.0-SNAPSHOT</version>
|
<groupId>world.bentobox</groupId>
|
||||||
<name>addon-limits</name>
|
<artifactId>limits</artifactId>
|
||||||
<description>An add-on for BentoBox that limits blocks and entities on islands.</description>
|
<version>0.2.2-SNAPSHOT</version>
|
||||||
<url>https://github.com/BentoBoxWorld/addon-level</url>
|
<name>addon-limits</name>
|
||||||
<inceptionYear>2018</inceptionYear>
|
<description>An add-on for BentoBox that limits blocks and entities on islands.</description>
|
||||||
|
<url>https://github.com/BentoBoxWorld/addon-level</url>
|
||||||
|
<inceptionYear>2018</inceptionYear>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:https://github.com/BentoBoxWorld/addon-limits.git</connection>
|
<connection>scm:git:https://github.com/BentoBoxWorld/addon-limits.git</connection>
|
||||||
<developerConnection>scm:git:git@github.com:BentoBoxWorld/addon-limits.git</developerConnection>
|
<developerConnection>scm:git:git@github.com:BentoBoxWorld/addon-limits.git</developerConnection>
|
||||||
<url>https://github.com/BentoBoxWorld/addon-limits</url>
|
<url>https://github.com/BentoBoxWorld/addon-limits</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>GitHub</system>
|
<system>GitHub</system>
|
||||||
<url>https://github.com/BentoBoxWorld/addon-limits/issues</url>
|
<url>https://github.com/BentoBoxWorld/addon-limits/issues</url>
|
||||||
</issueManagement>
|
</issueManagement>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<powermock.version>1.7.4</powermock.version>
|
<powermock.version>1.7.4</powermock.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>codemc</id>
|
<id>codemc</id>
|
||||||
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
|
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
<repository>
|
||||||
|
<id>codemc-repo</id>
|
||||||
|
<url>https://repo.codemc.org/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
<version>1.14.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-all</artifactId>
|
<artifactId>mockito-all</artifactId>
|
||||||
<version>1.10.19</version>
|
<version>1.10.19</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.powermock</groupId>
|
<groupId>org.powermock</groupId>
|
||||||
<artifactId>powermock-module-junit4</artifactId>
|
<artifactId>powermock-module-junit4</artifactId>
|
||||||
<version>${powermock.version}</version>
|
<version>${powermock.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.powermock</groupId>
|
<groupId>org.powermock</groupId>
|
||||||
<artifactId>powermock-api-mockito</artifactId>
|
<artifactId>powermock-api-mockito</artifactId>
|
||||||
<version>${powermock.version}</version>
|
<version>${powermock.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>bentobox</artifactId>
|
<artifactId>bentobox</artifactId>
|
||||||
<version>1.4.0-SNAPSHOT</version>
|
<version>1.5.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
<dependency>
|
||||||
|
<groupId>com.songoda</groupId>
|
||||||
|
<artifactId>EpicSpawners-API</artifactId>
|
||||||
|
<version>5.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>clean package</defaultGoal>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources/locales</directory>
|
||||||
|
<targetPath>./locales</targetPath>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.7.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
<configuration>
|
||||||
|
<show>public</show>
|
||||||
|
<failOnError>false</failOnError>
|
||||||
|
<additionalJOption>-Xdoclint:none</additionalJOption>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.1.1</version>
|
||||||
|
<configuration>
|
||||||
|
<minimizeJar>false</minimizeJar>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
|
<version>0.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<append>true</append>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>pre-unit-test</id>
|
||||||
|
<goals>
|
||||||
|
<goal>prepare-agent</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>post-unit-test</id>
|
||||||
|
<goals>
|
||||||
|
<goal>report</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
<build>
|
|
||||||
<defaultGoal>clean package</defaultGoal>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources/locales</directory>
|
|
||||||
<targetPath>./locales</targetPath>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.7.0</version>
|
|
||||||
<configuration>
|
|
||||||
<source>${java.version}</source>
|
|
||||||
<target>${java.version}</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.22.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<configuration>
|
|
||||||
<show>public</show>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
<additionalJOption>-Xdoclint:none</additionalJOption>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>3.1.1</version>
|
|
||||||
<configuration>
|
|
||||||
<minimizeJar>false</minimizeJar>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
|
||||||
<version>0.8.1</version>
|
|
||||||
<configuration>
|
|
||||||
<append>true</append>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>pre-unit-test</id>
|
|
||||||
<goals>
|
|
||||||
<goal>prepare-agent</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>post-unit-test</id>
|
|
||||||
<goals>
|
|
||||||
<goal>report</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -3,12 +3,14 @@ package bentobox.addon.limits;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import bentobox.addon.limits.commands.AdminCommand;
|
import bentobox.addon.limits.commands.AdminCommand;
|
||||||
import bentobox.addon.limits.commands.PlayerCommand;
|
import bentobox.addon.limits.commands.PlayerCommand;
|
||||||
import bentobox.addon.limits.listeners.BlockLimitsListener;
|
import bentobox.addon.limits.listeners.BlockLimitsListener;
|
||||||
import bentobox.addon.limits.listeners.EntityLimitListener;
|
import bentobox.addon.limits.listeners.EntityLimitListener;
|
||||||
|
import bentobox.addon.limits.listeners.EpicSpawnersListener;
|
||||||
import bentobox.addon.limits.listeners.JoinListener;
|
import bentobox.addon.limits.listeners.JoinListener;
|
||||||
import world.bentobox.bentobox.api.addons.Addon;
|
import world.bentobox.bentobox.api.addons.Addon;
|
||||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||||
|
@ -55,6 +57,12 @@ public class Limits extends Addon {
|
||||||
registerListener(blockLimitListener);
|
registerListener(blockLimitListener);
|
||||||
registerListener(new JoinListener(this));
|
registerListener(new JoinListener(this));
|
||||||
registerListener(new EntityLimitListener(this));
|
registerListener(new EntityLimitListener(this));
|
||||||
|
// Register epic spawners one tick after load
|
||||||
|
Bukkit.getScheduler().runTask(getPlugin(), () -> {
|
||||||
|
if (Bukkit.getServer().getPluginManager().getPlugin("EpicSpawners") != null) {
|
||||||
|
registerListener(new EpicSpawnersListener(this));
|
||||||
|
}
|
||||||
|
});
|
||||||
// Done
|
// Done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class LimitPanel {
|
||||||
E2M.put(EntityType.TRIDENT, null);
|
E2M.put(EntityType.TRIDENT, null);
|
||||||
E2M.put(EntityType.ARROW, null);
|
E2M.put(EntityType.ARROW, null);
|
||||||
E2M.put(EntityType.SPECTRAL_ARROW, null);
|
E2M.put(EntityType.SPECTRAL_ARROW, null);
|
||||||
E2M.put(EntityType.TIPPED_ARROW, null);
|
|
||||||
E2M.put(EntityType.SNOWBALL, null);
|
E2M.put(EntityType.SNOWBALL, null);
|
||||||
E2M.put(EntityType.EGG, null);
|
E2M.put(EntityType.EGG, null);
|
||||||
E2M.put(EntityType.LEASH_HITCH, null);
|
E2M.put(EntityType.LEASH_HITCH, null);
|
||||||
|
|
|
@ -135,6 +135,9 @@ public class LimitsCalc {
|
||||||
private void tidyUp() {
|
private void tidyUp() {
|
||||||
// Cancel
|
// Cancel
|
||||||
task.cancel();
|
task.cancel();
|
||||||
|
if (ibc == null) {
|
||||||
|
ibc = new IslandBlockCount();
|
||||||
|
}
|
||||||
ibc.setBlockCount(blockCount);
|
ibc.setBlockCount(blockCount);
|
||||||
bll.setIsland(island.getUniqueId(), ibc);
|
bll.setIsland(island.getUniqueId(), ibc);
|
||||||
sender.sendMessage("admin.limits.calc.finished");
|
sender.sendMessage("admin.limits.calc.finished");
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
@ -142,22 +143,26 @@ public class BlockLimitsListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlock(BlockBreakEvent e) {
|
public void onBlock(BlockBreakEvent e) {
|
||||||
notify(e, User.getInstance(e.getPlayer()), process(e.getBlock(), false), e.getBlock().getType());
|
handleBreak(e, e.getPlayer(), e.getBlock());
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleBreak(Cancellable e, Player player, Block b) {
|
||||||
|
notify(e, User.getInstance(player), process(b, false), b.getType());
|
||||||
// Player breaks a block and there was a redstone dust/repeater/... above
|
// Player breaks a block and there was a redstone dust/repeater/... above
|
||||||
if (e.getBlock().getRelative(BlockFace.UP).getType() == Material.REDSTONE_WIRE || e.getBlock().getRelative(BlockFace.UP).getType() == Material.REPEATER || e.getBlock().getRelative(BlockFace.UP).getType() == Material.COMPARATOR || e.getBlock().getRelative(BlockFace.UP).getType() == Material.REDSTONE_TORCH) {
|
if (b.getRelative(BlockFace.UP).getType() == Material.REDSTONE_WIRE || b.getRelative(BlockFace.UP).getType() == Material.REPEATER || b.getRelative(BlockFace.UP).getType() == Material.COMPARATOR || b.getRelative(BlockFace.UP).getType() == Material.REDSTONE_TORCH) {
|
||||||
process(e.getBlock().getRelative(BlockFace.UP), false);
|
process(b.getRelative(BlockFace.UP), false);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getRelative(BlockFace.EAST).getType() == Material.REDSTONE_WALL_TORCH) {
|
if (b.getRelative(BlockFace.EAST).getType() == Material.REDSTONE_WALL_TORCH) {
|
||||||
process(e.getBlock().getRelative(BlockFace.EAST), false);
|
process(b.getRelative(BlockFace.EAST), false);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getRelative(BlockFace.WEST).getType() == Material.REDSTONE_WALL_TORCH) {
|
if (b.getRelative(BlockFace.WEST).getType() == Material.REDSTONE_WALL_TORCH) {
|
||||||
process(e.getBlock().getRelative(BlockFace.WEST), false);
|
process(b.getRelative(BlockFace.WEST), false);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getRelative(BlockFace.SOUTH).getType() == Material.REDSTONE_WALL_TORCH) {
|
if (b.getRelative(BlockFace.SOUTH).getType() == Material.REDSTONE_WALL_TORCH) {
|
||||||
process(e.getBlock().getRelative(BlockFace.SOUTH), false);
|
process(b.getRelative(BlockFace.SOUTH), false);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getRelative(BlockFace.NORTH).getType() == Material.REDSTONE_WALL_TORCH) {
|
if (b.getRelative(BlockFace.NORTH).getType() == Material.REDSTONE_WALL_TORCH) {
|
||||||
process(e.getBlock().getRelative(BlockFace.NORTH), false);
|
process(b.getRelative(BlockFace.NORTH), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package bentobox.addon.limits.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
import com.songoda.epicspawners.api.events.SpawnerBreakEvent;
|
||||||
|
|
||||||
|
import bentobox.addon.limits.Limits;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author tastybento
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class EpicSpawnersListener implements Listener {
|
||||||
|
|
||||||
|
Limits addon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param addon
|
||||||
|
*/
|
||||||
|
public EpicSpawnersListener(Limits addon) {
|
||||||
|
this.addon = addon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onBlockBreak(SpawnerBreakEvent e) {
|
||||||
|
Block b = e.getSpawner().getLocation().getBlock();
|
||||||
|
addon.getBlockLimitListener().handleBreak(e, e.getPlayer(), b);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -37,8 +37,8 @@ public class JoinListener implements Listener {
|
||||||
|
|
||||||
private void checkPerms(Player player, String permissionPrefix, String islandId, String gameMode) {
|
private void checkPerms(Player player, String permissionPrefix, String islandId, String gameMode) {
|
||||||
IslandBlockCount ibc = addon.getBlockLimitListener().getIsland(islandId);
|
IslandBlockCount ibc = addon.getBlockLimitListener().getIsland(islandId);
|
||||||
int limit = -1;
|
|
||||||
for (PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
|
for (PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
|
||||||
|
int limit = -1;
|
||||||
if (perms.getPermission().startsWith(permissionPrefix)) {
|
if (perms.getPermission().startsWith(permissionPrefix)) {
|
||||||
// Get the Material
|
// Get the Material
|
||||||
String[] split = perms.getPermission().split("\\.");
|
String[] split = perms.getPermission().split("\\.");
|
||||||
|
|
Loading…
Reference in New Issue