mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-09-19 18:30:58 +02:00
Merge branch 'development'
This commit is contained in:
commit
36bda4a409
@ -1,214 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>com.songoda</groupId>
|
|
||||||
<artifactId>skyblock</artifactId>
|
|
||||||
<version>2.1.1</version>
|
|
||||||
<build>
|
|
||||||
<defaultGoal>clean install</defaultGoal>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<finalName>FabledSkyblock-${project.version}</finalName>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
|
||||||
<artifactId>replacer</artifactId>
|
|
||||||
<version>1.5.3</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>prepare-package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>replace</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<file>${project.build.directory}/classes/plugin.yml</file>
|
|
||||||
<replacements>
|
|
||||||
<replacement>
|
|
||||||
<token>maven-version-number</token>
|
|
||||||
<value>${project.version}</value>
|
|
||||||
</replacement>
|
|
||||||
</replacements>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>3.2.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>mvdw-software</id>
|
|
||||||
<name>MVdW Public Repositories</name>
|
|
||||||
<url>http://repo.mvdw-software.be/content/groups/public/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>spigot-repo</id>
|
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>minecraft-repo</id>
|
|
||||||
<url>https://libraries.minecraft.net/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>placeholderapi</id>
|
|
||||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>jitpack.io</id>
|
|
||||||
<url>https://jitpack.io</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>reserve-repo</id>
|
|
||||||
<url>https://dl.bintray.com/theneweconomy/java/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>private</id>
|
|
||||||
<url>https://repo.songoda.com/artifactory/private/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot-api</artifactId>
|
|
||||||
<version>1.15.1-R0.1-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>snakeyaml</artifactId>
|
|
||||||
<groupId>org.yaml</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.clip</groupId>
|
|
||||||
<artifactId>placeholderapi</artifactId>
|
|
||||||
<version>2.9.2</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.MilkBowl</groupId>
|
|
||||||
<artifactId>VaultAPI</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>bukkit</artifactId>
|
|
||||||
<groupId>org.bukkit</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.tnemc</groupId>
|
|
||||||
<artifactId>Reserve</artifactId>
|
|
||||||
<version>0.1.3.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.robin</groupId>
|
|
||||||
<artifactId>leaderheads</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.songoda</groupId>
|
|
||||||
<artifactId>epicspawners</artifactId>
|
|
||||||
<version>6-pre4</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.songoda</groupId>
|
|
||||||
<artifactId>EpicAnchors</artifactId>
|
|
||||||
<version>1.4.2</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.songoda</groupId>
|
|
||||||
<artifactId>ultimatestacker</artifactId>
|
|
||||||
<version>1.3.1</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.OmerBenGera</groupId>
|
|
||||||
<artifactId>WildStackerAPI</artifactId>
|
|
||||||
<version>b15</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>worldedit</artifactId>
|
|
||||||
<version>7.0.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mojang</groupId>
|
|
||||||
<artifactId>authlib</artifactId>
|
|
||||||
<version>1.5.3</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>log4j-core</artifactId>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>log4j-api</artifactId>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
9
pom.xml
9
pom.xml
@ -5,7 +5,8 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>skyblock</artifactId>
|
<artifactId>skyblock</artifactId>
|
||||||
<version>2.2.9</version>
|
<version>2.2.19</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>clean install</defaultGoal>
|
<defaultGoal>clean install</defaultGoal>
|
||||||
<finalName>FabledSkyblock-${project.version}</finalName>
|
<finalName>FabledSkyblock-${project.version}</finalName>
|
||||||
@ -119,10 +120,6 @@
|
|||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>private</id>
|
|
||||||
<url>https://repo.songoda.com/artifactory/private/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>public</id>
|
<id>public</id>
|
||||||
<url>http://repo.songoda.com/artifactory/public/</url>
|
<url>http://repo.songoda.com/artifactory/public/</url>
|
||||||
@ -172,7 +169,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.robin</groupId>
|
<groupId>me.robin</groupId>
|
||||||
<artifactId>leaderheads</artifactId>
|
<artifactId>LeaderHeadsAPI</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
33
skyblock.iml
33
skyblock.iml
@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.15" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.21" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.OmerBenGera:WildStackerAPI:b15" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.songoda:ultimatestacker:1.3.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: be.maximvdw:MVdWPlaceholderAPI:2.1.1-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.9.2" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.robin:leaderheads:1.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.songoda:epicspawners:6-pre4" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.songoda:EpicAnchors:1.4.2" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:7.0.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.songoda:SongodaCore:2.3.4" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -192,12 +192,6 @@ public class SkyBlock extends SongodaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPluginDisable() {
|
public void onPluginDisable() {
|
||||||
ConsoleCommandSender console = Bukkit.getConsoleSender();
|
|
||||||
console.sendMessage(formatText("&a============================="));
|
|
||||||
console.sendMessage(formatText("&7FabledSkyBlock " + this.getDescription().getVersion() + " by &5Songoda <3&7!"));
|
|
||||||
console.sendMessage(formatText("&7Action: &cDisabling&7..."));
|
|
||||||
console.sendMessage(formatText("&a============================="));
|
|
||||||
|
|
||||||
if (this.userCacheManager != null) {
|
if (this.userCacheManager != null) {
|
||||||
this.userCacheManager.onDisable();
|
this.userCacheManager.onDisable();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.songoda.skyblock.api.event.player;
|
||||||
|
|
||||||
|
import com.songoda.skyblock.api.island.Island;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class PlayerVoteEvent extends PlayerEvent implements Cancellable {
|
||||||
|
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
|
private static HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
public PlayerVoteEvent(Player player, Island island) {
|
||||||
|
super(player, island);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancelled = cancel;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.skyblock.api.event.player;
|
||||||
|
|
||||||
|
import com.songoda.skyblock.api.island.Island;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class PlayerVoteRemoveEvent extends PlayerEvent {
|
||||||
|
private static HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
public PlayerVoteRemoveEvent(Player player, Island island) {
|
||||||
|
super(player, island);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package com.songoda.skyblock.command.commands.island;
|
package com.songoda.skyblock.command.commands.island;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.CompatibleSound;
|
import com.songoda.core.compatibility.CompatibleSound;
|
||||||
|
import com.songoda.skyblock.api.event.player.PlayerVoteEvent;
|
||||||
|
import com.songoda.skyblock.api.event.player.PlayerVoteRemoveEvent;
|
||||||
import com.songoda.skyblock.command.SubCommand;
|
import com.songoda.skyblock.command.SubCommand;
|
||||||
import com.songoda.skyblock.config.FileManager;
|
import com.songoda.skyblock.config.FileManager;
|
||||||
import com.songoda.skyblock.config.FileManager.Config;
|
import com.songoda.skyblock.config.FileManager.Config;
|
||||||
@ -85,6 +87,7 @@ public class VoteCommand extends SubCommand {
|
|||||||
|
|
||||||
if (playerData.getIsland() != null && playerData.getIsland().equals(island.getOwnerUUID())) {
|
if (playerData.getIsland() != null && playerData.getIsland().equals(island.getOwnerUUID())) {
|
||||||
if (visit.getVoters().contains(player.getUniqueId())) {
|
if (visit.getVoters().contains(player.getUniqueId())) {
|
||||||
|
Bukkit.getPluginManager().callEvent(new PlayerVoteRemoveEvent(player, island.getAPIWrapper()));
|
||||||
visit.removeVoter(player.getUniqueId());
|
visit.removeVoter(player.getUniqueId());
|
||||||
|
|
||||||
messageManager.sendMessage(player,
|
messageManager.sendMessage(player,
|
||||||
@ -92,6 +95,11 @@ public class VoteCommand extends SubCommand {
|
|||||||
.replace("%player", targetPlayerName));
|
.replace("%player", targetPlayerName));
|
||||||
soundManager.playSound(player, CompatibleSound.ENTITY_GENERIC_EXPLODE.getSound(), 1.0F, 1.0F);
|
soundManager.playSound(player, CompatibleSound.ENTITY_GENERIC_EXPLODE.getSound(), 1.0F, 1.0F);
|
||||||
} else {
|
} else {
|
||||||
|
PlayerVoteEvent playerVoteEvent = new PlayerVoteEvent(player, island.getAPIWrapper());
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(playerVoteEvent);
|
||||||
|
if (playerVoteEvent.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
visit.addVoter(player.getUniqueId());
|
visit.addVoter(player.getUniqueId());
|
||||||
|
|
||||||
messageManager.sendMessage(player,
|
messageManager.sendMessage(player,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.songoda.skyblock.island;
|
package com.songoda.skyblock.island;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.CompatibleSound;
|
import com.songoda.core.compatibility.CompatibleSound;
|
||||||
|
import com.songoda.core.utils.PlayerUtils;
|
||||||
import com.songoda.skyblock.SkyBlock;
|
import com.songoda.skyblock.SkyBlock;
|
||||||
import com.songoda.skyblock.api.event.island.*;
|
import com.songoda.skyblock.api.event.island.*;
|
||||||
import com.songoda.skyblock.api.utils.APIUtil;
|
import com.songoda.skyblock.api.utils.APIUtil;
|
||||||
@ -59,6 +60,24 @@ public class Island {
|
|||||||
this.size = 50;
|
this.size = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.isOnline()) {
|
||||||
|
int customSize = PlayerUtils.getNumberFromPermission(player.getPlayer(), "fabledskyblock.size", 0);
|
||||||
|
if (customSize > 0 || player.getPlayer().hasPermission("fabledskyblock.*")) {
|
||||||
|
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||||
|
FileConfiguration configLoad = config.getFileConfiguration();
|
||||||
|
|
||||||
|
int minimumSize = configLoad.getInt("Island.Size.Minimum");
|
||||||
|
int maximumSize = configLoad.getInt("Island.Size.Maximum");
|
||||||
|
|
||||||
|
if (minimumSize < 0 || minimumSize > 1000)
|
||||||
|
minimumSize = 50;
|
||||||
|
if (maximumSize < 0 || maximumSize > 1000)
|
||||||
|
maximumSize = 100;
|
||||||
|
|
||||||
|
size = Math.max(minimumSize, Math.min(customSize, maximumSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
level = new IslandLevel(getOwnerUUID(), skyblock);
|
level = new IslandLevel(getOwnerUUID(), skyblock);
|
||||||
|
|
||||||
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data");
|
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data");
|
||||||
|
@ -3,11 +3,13 @@ package com.songoda.skyblock.island;
|
|||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.compatibility.CompatibleSound;
|
import com.songoda.core.compatibility.CompatibleSound;
|
||||||
|
import com.songoda.core.utils.PlayerUtils;
|
||||||
import com.songoda.skyblock.SkyBlock;
|
import com.songoda.skyblock.SkyBlock;
|
||||||
import com.songoda.skyblock.api.event.island.*;
|
import com.songoda.skyblock.api.event.island.*;
|
||||||
import com.songoda.skyblock.ban.BanManager;
|
import com.songoda.skyblock.ban.BanManager;
|
||||||
import com.songoda.skyblock.config.FileManager;
|
import com.songoda.skyblock.config.FileManager;
|
||||||
import com.songoda.skyblock.config.FileManager.Config;
|
import com.songoda.skyblock.config.FileManager.Config;
|
||||||
|
import com.songoda.skyblock.confirmation.Confirmation;
|
||||||
import com.songoda.skyblock.cooldown.CooldownManager;
|
import com.songoda.skyblock.cooldown.CooldownManager;
|
||||||
import com.songoda.skyblock.cooldown.CooldownType;
|
import com.songoda.skyblock.cooldown.CooldownType;
|
||||||
import com.songoda.skyblock.invite.Invite;
|
import com.songoda.skyblock.invite.Invite;
|
||||||
@ -35,6 +37,10 @@ import com.songoda.skyblock.utils.world.WorldBorder;
|
|||||||
import com.songoda.skyblock.utils.world.block.BlockDegreesType;
|
import com.songoda.skyblock.utils.world.block.BlockDegreesType;
|
||||||
import com.songoda.skyblock.visit.VisitManager;
|
import com.songoda.skyblock.visit.VisitManager;
|
||||||
import com.songoda.skyblock.world.WorldManager;
|
import com.songoda.skyblock.world.WorldManager;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -43,11 +49,6 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.IllegalPluginAccessException;
|
import org.bukkit.plugin.IllegalPluginAccessException;
|
||||||
import com.songoda.skyblock.confirmation.Confirmation;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -80,7 +81,8 @@ public class IslandManager {
|
|||||||
loadIsland(all);
|
loadIsland(all);
|
||||||
}
|
}
|
||||||
for (Island island : getIslands().values()) {
|
for (Island island : getIslands().values()) {
|
||||||
if (island.isAlwaysLoaded()) loadIslandAtLocation(island.getLocation(IslandWorld.Normal, IslandEnvironment.Island));
|
if (island.isAlwaysLoaded())
|
||||||
|
loadIslandAtLocation(island.getLocation(IslandWorld.Normal, IslandEnvironment.Island));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadIslandPositions();
|
loadIslandPositions();
|
||||||
@ -126,7 +128,6 @@ public class IslandManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public org.bukkit.Location prepareNextAvailableLocation(IslandWorld world) {
|
public org.bukkit.Location prepareNextAvailableLocation(IslandWorld world) {
|
||||||
for (IslandPosition islandPositionList : islandPositions) {
|
for (IslandPosition islandPositionList : islandPositions) {
|
||||||
if (islandPositionList.getWorld() == world) {
|
if (islandPositionList.getWorld() == world) {
|
||||||
@ -140,15 +141,15 @@ public class IslandManager {
|
|||||||
int islandHeight = configLoad_config.getInt("Island.World." + world.name() + ".IslandSpawnHeight", 72);
|
int islandHeight = configLoad_config.getInt("Island.World." + world.name() + ".IslandSpawnHeight", 72);
|
||||||
while (true) {
|
while (true) {
|
||||||
double r = Math.floor((Math.sqrt(x + 1) - 1) / 2) + 1;
|
double r = Math.floor((Math.sqrt(x + 1) - 1) / 2) + 1;
|
||||||
double p = (8 * r * (r -1)) / 2;
|
double p = (8 * r * (r - 1)) / 2;
|
||||||
double en = r * 2;
|
double en = r * 2;
|
||||||
double a = (x - p) % (r * 8);
|
double a = (x - p) % (r * 8);
|
||||||
int posX = 0;
|
int posX = 0;
|
||||||
int posY = 0;
|
int posY = 0;
|
||||||
int loc = (int) Math.floor(a / (r * 2));
|
int loc = (int) Math.floor(a / (r * 2));
|
||||||
switch (loc) {
|
switch (loc) {
|
||||||
case 0 :
|
case 0:
|
||||||
posX = (int) (a-r);
|
posX = (int) (a - r);
|
||||||
posY = (int) (-r);
|
posY = (int) (-r);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -226,36 +227,14 @@ public class IslandManager {
|
|||||||
|
|
||||||
if (!visitManager.hasIsland(island.getOwnerUUID())) {
|
if (!visitManager.hasIsland(island.getOwnerUUID())) {
|
||||||
visitManager.createIsland(island.getOwnerUUID(),
|
visitManager.createIsland(island.getOwnerUUID(),
|
||||||
new IslandLocation[] { island.getIslandLocation(IslandWorld.Normal, IslandEnvironment.Island), island.getIslandLocation(IslandWorld.Nether, IslandEnvironment.Island),
|
new IslandLocation[]{island.getIslandLocation(IslandWorld.Normal, IslandEnvironment.Island), island.getIslandLocation(IslandWorld.Nether, IslandEnvironment.Island),
|
||||||
island.getIslandLocation(IslandWorld.End, IslandEnvironment.Island) },
|
island.getIslandLocation(IslandWorld.End, IslandEnvironment.Island)},
|
||||||
island.getSize(), island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() + 1, island.getBankBalance(), visitManager.getIslandSafeLevel(island.getOwnerUUID()), island.getLevel(),
|
island.getSize(), island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() + 1, island.getBankBalance(), visitManager.getIslandSafeLevel(island.getOwnerUUID()), island.getLevel(),
|
||||||
island.getMessage(IslandMessage.Signature), island.isOpen());
|
island.getMessage(IslandMessage.Signature), island.isOpen());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!banManager.hasIsland(island.getOwnerUUID())) banManager.createIsland(island.getOwnerUUID());
|
if (!banManager.hasIsland(island.getOwnerUUID())) banManager.createIsland(island.getOwnerUUID());
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().runTask(skyblock, () -> {
|
|
||||||
if (PlayerUtil.getNumberFromPermission(player, "fabledskyblock.size", false, 0) > 0 || player.hasPermission("fabledskyblock.*")) {
|
|
||||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
|
||||||
FileConfiguration configLoad = config.getFileConfiguration();
|
|
||||||
|
|
||||||
int minimumSize = configLoad.getInt("Island.Size.Minimum");
|
|
||||||
int maximumSize = configLoad.getInt("Island.Size.Maximum");
|
|
||||||
|
|
||||||
if (minimumSize < 0 || minimumSize > 1000) {
|
|
||||||
minimumSize = 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maximumSize < 0 || maximumSize > 1000) {
|
|
||||||
maximumSize = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = maximumSize; i > minimumSize; i--) {
|
|
||||||
island.setSize(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||||
FileConfiguration configLoad = config.getFileConfiguration();
|
FileConfiguration configLoad = config.getFileConfiguration();
|
||||||
|
|
||||||
@ -301,7 +280,8 @@ public class IslandManager {
|
|||||||
}, 20L);
|
}, 20L);
|
||||||
|
|
||||||
// Recalculate island level after 5 seconds
|
// Recalculate island level after 5 seconds
|
||||||
if (configLoad.getBoolean("Island.Levelling.ScanAutomatically")) Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().startScan(null, island), 100L);
|
if (configLoad.getBoolean("Island.Levelling.ScanAutomatically"))
|
||||||
|
Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().startScan(null, island), 100L);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -350,7 +330,7 @@ public class IslandManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(skyblock, () -> {
|
Bukkit.getScheduler().runTaskLater(skyblock, () -> {
|
||||||
if(data.isPreview()) {
|
if (data.isPreview()) {
|
||||||
Location spawn = fileManager.getLocation(fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml")), "Location.Spawn", true);
|
Location spawn = fileManager.getLocation(fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml")), "Location.Spawn", true);
|
||||||
player.teleport(spawn);
|
player.teleport(spawn);
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
@ -360,8 +340,7 @@ public class IslandManager {
|
|||||||
skyblock.getMessageManager().sendMessage(player, configLang.getString("Island.Preview.Timeout.Message"));
|
skyblock.getMessageManager().sendMessage(player, configLang.getString("Island.Preview.Timeout.Message"));
|
||||||
data.setPreview(false);
|
data.setPreview(false);
|
||||||
}
|
}
|
||||||
}, configMain.getInt("Island.Preview.Time")*20);
|
}, configMain.getInt("Island.Preview.Time") * 20);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String defaultMessage = configLang.getString("Command.Island.Preview.Confirmation.Message")
|
String defaultMessage = configLang.getString("Command.Island.Preview.Confirmation.Message")
|
||||||
@ -372,7 +351,7 @@ public class IslandManager {
|
|||||||
for (String message : defaultMessage.split("\n")) {
|
for (String message : defaultMessage.split("\n")) {
|
||||||
ChatComponent confirmation = null, cancelation = null;
|
ChatComponent confirmation = null, cancelation = null;
|
||||||
|
|
||||||
if(message.contains("%confirm")) {
|
if (message.contains("%confirm")) {
|
||||||
message = message.replace("%confirm", "");
|
message = message.replace("%confirm", "");
|
||||||
confirmation = new ChatComponent(configLang.getString("Command.Island.Preview.Confirmation.Word.Confirm").toUpperCase() + " ",
|
confirmation = new ChatComponent(configLang.getString("Command.Island.Preview.Confirmation.Word.Confirm").toUpperCase() + " ",
|
||||||
true, net.md_5.bungee.api.ChatColor.GREEN,
|
true, net.md_5.bungee.api.ChatColor.GREEN,
|
||||||
@ -386,7 +365,7 @@ public class IslandManager {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(message.contains("%cancel")) {
|
if (message.contains("%cancel")) {
|
||||||
message = message.replace("%cancel", "");
|
message = message.replace("%cancel", "");
|
||||||
cancelation = new ChatComponent(configLang.getString("Command.Island.Preview.Confirmation.Word.Cancel").toUpperCase(),
|
cancelation = new ChatComponent(configLang.getString("Command.Island.Preview.Confirmation.Word.Cancel").toUpperCase(),
|
||||||
true, net.md_5.bungee.api.ChatColor.GREEN,
|
true, net.md_5.bungee.api.ChatColor.GREEN,
|
||||||
@ -401,10 +380,10 @@ public class IslandManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TextComponent confirmationMessage = new TextComponent(net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', message));
|
TextComponent confirmationMessage = new TextComponent(net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', message));
|
||||||
if(confirmation != null) {
|
if (confirmation != null) {
|
||||||
confirmationMessage.addExtra(confirmation.getTextComponent());
|
confirmationMessage.addExtra(confirmation.getTextComponent());
|
||||||
}
|
}
|
||||||
if(cancelation != null) {
|
if (cancelation != null) {
|
||||||
confirmationMessage.addExtra(cancelation.getTextComponent());
|
confirmationMessage.addExtra(cancelation.getTextComponent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,8 +675,8 @@ public class IslandManager {
|
|||||||
|
|
||||||
if (!visitManager.hasIsland(island.getOwnerUUID())) {
|
if (!visitManager.hasIsland(island.getOwnerUUID())) {
|
||||||
visitManager.createIsland(island.getOwnerUUID(),
|
visitManager.createIsland(island.getOwnerUUID(),
|
||||||
new IslandLocation[] { island.getIslandLocation(IslandWorld.Normal, IslandEnvironment.Island), island.getIslandLocation(IslandWorld.Nether, IslandEnvironment.Island),
|
new IslandLocation[]{island.getIslandLocation(IslandWorld.Normal, IslandEnvironment.Island), island.getIslandLocation(IslandWorld.Nether, IslandEnvironment.Island),
|
||||||
island.getIslandLocation(IslandWorld.End, IslandEnvironment.Island) },
|
island.getIslandLocation(IslandWorld.End, IslandEnvironment.Island)},
|
||||||
island.getSize(), island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() + 1, island.getBankBalance(), visitManager.getIslandSafeLevel(island.getOwnerUUID()),
|
island.getSize(), island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() + 1, island.getBankBalance(), visitManager.getIslandSafeLevel(island.getOwnerUUID()),
|
||||||
island.getLevel(), island.getMessage(IslandMessage.Signature), island.isOpen());
|
island.getLevel(), island.getMessage(IslandMessage.Signature), island.isOpen());
|
||||||
}
|
}
|
||||||
@ -1217,7 +1196,8 @@ public class IslandManager {
|
|||||||
|
|
||||||
if (island.getSetting(island.getRole(player), setting).getStatus()) return true;
|
if (island.getSetting(island.getRole(player), setting).getStatus()) return true;
|
||||||
|
|
||||||
if (island.isCoopPlayer(player.getUniqueId()) && island.getSetting(IslandRole.Coop, setting).getStatus()) return true;
|
if (island.isCoopPlayer(player.getUniqueId()) && island.getSetting(IslandRole.Coop, setting).getStatus())
|
||||||
|
return true;
|
||||||
|
|
||||||
return island.getSetting(IslandRole.Visitor, setting).getStatus();
|
return island.getSetting(IslandRole.Visitor, setting).getStatus();
|
||||||
}
|
}
|
||||||
@ -1355,7 +1335,8 @@ public class IslandManager {
|
|||||||
public void updateFlight(Player player) {
|
public void updateFlight(Player player) {
|
||||||
// The player can fly in other worlds if they are in creative or have another
|
// The player can fly in other worlds if they are in creative or have another
|
||||||
// plugin's fly permission.
|
// plugin's fly permission.
|
||||||
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly")) return;
|
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly"))
|
||||||
|
return;
|
||||||
|
|
||||||
Island island = getIslandAtLocation(player.getLocation());
|
Island island = getIslandAtLocation(player.getLocation());
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import com.songoda.skyblock.sound.SoundManager;
|
|||||||
import com.songoda.skyblock.stackable.Stackable;
|
import com.songoda.skyblock.stackable.Stackable;
|
||||||
import com.songoda.skyblock.stackable.StackableManager;
|
import com.songoda.skyblock.stackable.StackableManager;
|
||||||
import com.songoda.skyblock.utils.NumberUtil;
|
import com.songoda.skyblock.utils.NumberUtil;
|
||||||
import com.songoda.skyblock.utils.item.InventoryUtil;
|
|
||||||
import com.songoda.skyblock.utils.structure.StructureUtil;
|
import com.songoda.skyblock.utils.structure.StructureUtil;
|
||||||
import com.songoda.skyblock.utils.version.NMSUtil;
|
import com.songoda.skyblock.utils.version.NMSUtil;
|
||||||
import com.songoda.skyblock.world.WorldManager;
|
import com.songoda.skyblock.world.WorldManager;
|
||||||
@ -42,7 +41,6 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
@ -153,11 +151,6 @@ public class Interact implements Listener {
|
|||||||
.hasPermission(player, block.getLocation(), "Place")
|
.hasPermission(player, block.getLocation(), "Place")
|
||||||
&& (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Stackable.RequirePermission")
|
&& (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Stackable.RequirePermission")
|
||||||
|| player.hasPermission("fabledskyblock.stackable"))) {
|
|| player.hasPermission("fabledskyblock.stackable"))) {
|
||||||
if (NMSUtil.getVersionNumber() > 8) {
|
|
||||||
if (event.getHand() == EquipmentSlot.OFF_HAND) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (levellingManager.isScanning(island)) {
|
if (levellingManager.isScanning(island)) {
|
||||||
skyblock.getMessageManager().sendMessage(player,
|
skyblock.getMessageManager().sendMessage(player,
|
||||||
@ -223,7 +216,8 @@ public class Interact implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryUtil.takeItem(player, itemAmount);
|
if (player.getGameMode() != GameMode.CREATIVE)
|
||||||
|
ItemUtils.takeActiveItem(player, CompatibleHand.getHand(event), itemAmount);
|
||||||
|
|
||||||
if (!configLoad.getBoolean("Island.Block.Level.Enable")) {
|
if (!configLoad.getBoolean("Island.Block.Level.Enable")) {
|
||||||
return;
|
return;
|
||||||
@ -706,8 +700,8 @@ public class Interact implements Listener {
|
|||||||
SoundManager soundManager = skyblock.getSoundManager();
|
SoundManager soundManager = skyblock.getSoundManager();
|
||||||
|
|
||||||
if (skyblock.getWorldManager().isIslandWorld(entity.getWorld())) {
|
if (skyblock.getWorldManager().isIslandWorld(entity.getWorld())) {
|
||||||
if ((is != null) && (CompatibleMaterial.getMaterial(is.getType()) != CompatibleMaterial.AIR)) {
|
if ((is != null) && (CompatibleMaterial.getMaterial(is) != CompatibleMaterial.AIR)) {
|
||||||
if (CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.LEAD) {
|
if (CompatibleMaterial.getMaterial(is) == CompatibleMaterial.LEAD) {
|
||||||
if (!islandManager.hasPermission(player, entity.getLocation(), "Leash")) {
|
if (!islandManager.hasPermission(player, entity.getLocation(), "Leash")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
@ -771,7 +765,7 @@ public class Interact implements Listener {
|
|||||||
skyblock.getSoundManager().playSound(player, CompatibleSound.ENTITY_VILLAGER_NO.getSound(), 1.0F, 1.0F);
|
skyblock.getSoundManager().playSound(player, CompatibleSound.ENTITY_VILLAGER_NO.getSound(), 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) {
|
} else if (entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) {
|
||||||
if (CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.BUCKET) {
|
if (CompatibleMaterial.getMaterial(is) == CompatibleMaterial.BUCKET) {
|
||||||
if (!islandManager.hasPermission(player, entity.getLocation(), "Milking")) {
|
if (!islandManager.hasPermission(player, entity.getLocation(), "Milking")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
@ -825,27 +819,27 @@ public class Interact implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entity.getType() == EntityType.HORSE) {
|
if (entity.getType() == EntityType.HORSE) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.GOLDEN_APPLE
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.GOLDEN_APPLE
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.GOLDEN_CARROT
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.GOLDEN_CARROT
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.SUGAR
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.SUGAR
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.WHEAT
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.WHEAT
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.APPLE
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.APPLE
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.HAY_BLOCK)) {
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.HAY_BLOCK)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.SHEEP || entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) {
|
} else if (entity.getType() == EntityType.SHEEP || entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.WHEAT)) {
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.WHEAT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.PIG) {
|
} else if (entity.getType() == EntityType.PIG) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.CARROT || CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.POTATO)) {
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.CARROT || CompatibleMaterial.getMaterial(is) == CompatibleMaterial.POTATO)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.CHICKEN) {
|
} else if (entity.getType() == EntityType.CHICKEN) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.WHEAT_SEEDS
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.WHEAT_SEEDS
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.PUMPKIN_SEEDS || CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.MELON_SEEDS)) {
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.PUMPKIN_SEEDS || CompatibleMaterial.getMaterial(is) == CompatibleMaterial.MELON_SEEDS)) {
|
||||||
if (NMSUtil.getVersionNumber() > 8) {
|
if (NMSUtil.getVersionNumber() > 8) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.BEETROOT_SEEDS)) {
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.BEETROOT_SEEDS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -853,31 +847,31 @@ public class Interact implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.WOLF) {
|
} else if (entity.getType() == EntityType.WOLF) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.BONE
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.BONE
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.PORKCHOP
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.PORKCHOP
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.BEEF
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.BEEF
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.CHICKEN
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.CHICKEN
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.RABBIT
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.RABBIT
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.MUTTON
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.MUTTON
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.ROTTEN_FLESH
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.ROTTEN_FLESH
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COOKED_PORKCHOP
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COOKED_PORKCHOP
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COOKED_BEEF
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COOKED_BEEF
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COOKED_CHICKEN
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COOKED_CHICKEN
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COOKED_RABBIT
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COOKED_RABBIT
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COOKED_MUTTON)) {
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COOKED_MUTTON)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.OCELOT) {
|
} else if (entity.getType() == EntityType.OCELOT) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.COD
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.COD
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.SALMON
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.SALMON
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.TROPICAL_FISH
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.TROPICAL_FISH
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.PUFFERFISH)) {
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.PUFFERFISH)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (entity.getType() == EntityType.RABBIT) {
|
} else if (entity.getType() == EntityType.RABBIT) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.DANDELION
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.DANDELION
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.CARROTS
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.CARROTS
|
||||||
|| CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.GOLDEN_CARROT)) {
|
|| CompatibleMaterial.getMaterial(is) == CompatibleMaterial.GOLDEN_CARROT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -885,12 +879,12 @@ public class Interact implements Listener {
|
|||||||
|
|
||||||
if (NMSVersion > 10) {
|
if (NMSVersion > 10) {
|
||||||
if (entity.getType() == EntityType.LLAMA) {
|
if (entity.getType() == EntityType.LLAMA) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.HAY_BLOCK)) {
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.HAY_BLOCK)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (NMSVersion > 12) {
|
} else if (NMSVersion > 12) {
|
||||||
if (entity.getType() == EntityType.TURTLE) {
|
if (entity.getType() == EntityType.TURTLE) {
|
||||||
if (!(CompatibleMaterial.getMaterial(is.getType()) == CompatibleMaterial.SEAGRASS)) {
|
if (!(CompatibleMaterial.getMaterial(is) == CompatibleMaterial.SEAGRASS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -198,7 +198,7 @@ public class Levelling {
|
|||||||
if (is == null || is.getItemMeta() == null) continue;
|
if (is == null || is.getItemMeta() == null) continue;
|
||||||
|
|
||||||
is.setAmount(Math.min(Math.toIntExact(value), 64));
|
is.setAmount(Math.min(Math.toIntExact(value), 64));
|
||||||
is.setType(CompatibleMaterial.getMaterial(is.getType()).getMaterial());
|
is.setType(CompatibleMaterial.getMaterial(is).getMaterial());
|
||||||
|
|
||||||
testInventory.clear();
|
testInventory.clear();
|
||||||
testInventory.setItem(0, is);
|
testInventory.setItem(0, is);
|
||||||
@ -269,7 +269,7 @@ public class Levelling {
|
|||||||
|
|
||||||
ItemStack is = materials.getItem();
|
ItemStack is = materials.getItem();
|
||||||
is.setAmount(Math.min(Math.toIntExact(materialAmount), 64));
|
is.setAmount(Math.min(Math.toIntExact(materialAmount), 64));
|
||||||
is.setType(CompatibleMaterial.getMaterial(is.getType()).getMaterial());
|
is.setType(CompatibleMaterial.getMaterial(is).getMaterial());
|
||||||
|
|
||||||
List<String> lore = configLoad.getStringList("Menu.Levelling.Item.Material.Lore");
|
List<String> lore = configLoad.getStringList("Menu.Levelling.Item.Material.Lore");
|
||||||
lore.replaceAll(x -> x.replace("%points", NumberUtil.formatNumberByDecimal(pointsEarned)).replace("%blocks", NumberUtil.formatNumberByDecimal(materialAmount)).replace("%material", name));
|
lore.replaceAll(x -> x.replace("%points", NumberUtil.formatNumberByDecimal(pointsEarned)).replace("%blocks", NumberUtil.formatNumberByDecimal(materialAmount)).replace("%material", name));
|
||||||
|
@ -3,6 +3,7 @@ package com.songoda.skyblock.menus;
|
|||||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.compatibility.CompatibleSound;
|
import com.songoda.core.compatibility.CompatibleSound;
|
||||||
import com.songoda.skyblock.SkyBlock;
|
import com.songoda.skyblock.SkyBlock;
|
||||||
|
import com.songoda.skyblock.api.event.player.PlayerVoteEvent;
|
||||||
import com.songoda.skyblock.config.FileManager;
|
import com.songoda.skyblock.config.FileManager;
|
||||||
import com.songoda.skyblock.config.FileManager.Config;
|
import com.songoda.skyblock.config.FileManager.Config;
|
||||||
import com.songoda.skyblock.island.Island;
|
import com.songoda.skyblock.island.Island;
|
||||||
@ -179,6 +180,11 @@ public class Visit {
|
|||||||
soundManager.playSound(player, CompatibleSound.ENTITY_GENERIC_EXPLODE.getSound(), 1.0F,
|
soundManager.playSound(player, CompatibleSound.ENTITY_GENERIC_EXPLODE.getSound(), 1.0F,
|
||||||
1.0F);
|
1.0F);
|
||||||
} else {
|
} else {
|
||||||
|
PlayerVoteEvent playerVoteEvent = new PlayerVoteEvent(player, island.getAPIWrapper());
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(playerVoteEvent);
|
||||||
|
if (playerVoteEvent.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
visit.addVoter(player.getUniqueId());
|
visit.addVoter(player.getUniqueId());
|
||||||
|
|
||||||
messageManager.sendMessage(player,
|
messageManager.sendMessage(player,
|
||||||
|
@ -38,7 +38,7 @@ public class StackableManager {
|
|||||||
FileConfiguration configLoad = config.getFileConfiguration();
|
FileConfiguration configLoad = config.getFileConfiguration();
|
||||||
|
|
||||||
List<String> stackableList = configLoad.getStringList("Stackables");
|
List<String> stackableList = configLoad.getStringList("Stackables");
|
||||||
if (stackableList == null) return;
|
if (stackableList.isEmpty()) return;
|
||||||
|
|
||||||
for (String stackableStr : stackableList) {
|
for (String stackableStr : stackableList) {
|
||||||
try {
|
try {
|
||||||
|
@ -59,7 +59,6 @@ public class HologramTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
removeHolograms();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spawnHologram(HologramType type, Location location, List<String> lines) {
|
public void spawnHologram(HologramType type, Location location, List<String> lines) {
|
||||||
@ -151,12 +150,6 @@ public class HologramTask extends BukkitRunnable {
|
|||||||
return hologramLines;
|
return hologramLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeHolograms() {
|
|
||||||
for (Hologram hologramList : hologramStorage) {
|
|
||||||
hologramList.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Hologram getHologram(HologramType type) {
|
public Hologram getHologram(HologramType type) {
|
||||||
for (Hologram hologramList : hologramStorage) {
|
for (Hologram hologramList : hologramStorage) {
|
||||||
if (hologramList.getType() == type) {
|
if (hologramList.getType() == type) {
|
||||||
|
@ -173,9 +173,7 @@ public class Visit {
|
|||||||
islandOwnerUUID.toString() + ".yml"))
|
islandOwnerUUID.toString() + ".yml"))
|
||||||
.getFileConfiguration();
|
.getFileConfiguration();
|
||||||
|
|
||||||
for (String islandVoterList : configLoad.getStringList("Voters")) {
|
islandVoters.addAll(configLoad.getStringList("Voters"));
|
||||||
islandVoters.add(islandVoterList);
|
|
||||||
}
|
|
||||||
|
|
||||||
islandVoters.add(uuid.toString());
|
islandVoters.add(uuid.toString());
|
||||||
configLoad.set("Voters", islandVoters);
|
configLoad.set("Voters", islandVoters);
|
||||||
|
@ -15,7 +15,7 @@ Island:
|
|||||||
# [!] Do not go over the maximum.
|
# [!] Do not go over the maximum.
|
||||||
# [!] Even numbers WILL create world border issues.
|
# [!] Even numbers WILL create world border issues.
|
||||||
Minimum: 100
|
Minimum: 100
|
||||||
# The maximum size of an Island based on the permission node 'skyblock.size.<size>'.
|
# The maximum size of an Island based on the permission node 'fabledskyblock.size.<size>'.
|
||||||
Maximum: 200
|
Maximum: 200
|
||||||
Creation:
|
Creation:
|
||||||
# Rather than opening the 'Island Creator' menu. Create an island
|
# Rather than opening the 'Island Creator' menu. Create an island
|
||||||
|
Loading…
Reference in New Issue
Block a user