mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2025-02-16 12:21:20 +01:00
Turned into a Pladdon
This commit is contained in:
parent
fe0e935e14
commit
d7bff1df7d
22
pom.xml
22
pom.xml
@ -135,6 +135,12 @@
|
|||||||
<version>${spigot.version}</version>
|
<version>${spigot.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>plugin-annotations</artifactId>
|
||||||
|
<version>1.2.3-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<!-- Mockito (Unit testing) -->
|
<!-- Mockito (Unit testing) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
@ -196,14 +202,6 @@
|
|||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.7.0</version>
|
|
||||||
<configuration>
|
|
||||||
<release>${java.version}</release>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
@ -272,6 +270,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.7.0</version>
|
||||||
|
<configuration>
|
||||||
|
<release>${java.version}</release>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
24
src/main/java/world/bentobox/limits/LimitsPladdon.java
Normal file
24
src/main/java/world/bentobox/limits/LimitsPladdon.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package world.bentobox.limits;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.java.annotation.dependency.Dependency;
|
||||||
|
import org.bukkit.plugin.java.annotation.plugin.ApiVersion;
|
||||||
|
import org.bukkit.plugin.java.annotation.plugin.Plugin;
|
||||||
|
|
||||||
|
import world.bentobox.bentobox.api.addons.Addon;
|
||||||
|
import world.bentobox.bentobox.api.addons.Pladdon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author YellowZaki
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Plugin(name="Pladdon", version="1.0")
|
||||||
|
@ApiVersion(ApiVersion.Target.v1_16)
|
||||||
|
@Dependency(value = "BentoBox")
|
||||||
|
public class LimitsPladdon extends Pladdon {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Addon getAddon() {
|
||||||
|
return new Limits();
|
||||||
|
}
|
||||||
|
}
|
@ -91,7 +91,7 @@ public class EntityLimitListener implements Listener {
|
|||||||
public void onBreed(final EntityBreedEvent e) {
|
public void onBreed(final EntityBreedEvent e) {
|
||||||
if (addon.inGameModeWorld(e.getEntity().getWorld())
|
if (addon.inGameModeWorld(e.getEntity().getWorld())
|
||||||
&& e.getBreeder() != null
|
&& e.getBreeder() != null
|
||||||
&& e.getBreeder() instanceof Player p
|
&& (e.getBreeder() instanceof Player p)
|
||||||
&& !(p.isOp() || p.hasPermission(addon.getPlugin().getIWM().getPermissionPrefix(e.getEntity().getWorld()) + MOD_BYPASS))
|
&& !(p.isOp() || p.hasPermission(addon.getPlugin().getIWM().getPermissionPrefix(e.getEntity().getWorld()) + MOD_BYPASS))
|
||||||
&& !checkLimit(e, e.getEntity(), SpawnReason.BREEDING, false)
|
&& !checkLimit(e, e.getEntity(), SpawnReason.BREEDING, false)
|
||||||
&& e.getFather() instanceof Animals f && e.getMother() instanceof Animals m) {
|
&& e.getFather() instanceof Animals f && e.getMother() instanceof Animals m) {
|
||||||
|
Loading…
Reference in New Issue
Block a user