Maven Project

# Added the alias '/island teleport <player>' to the command '/island visit [<player>]'.
# Fixed NSME when sending a World Border to a player on servers using 1.9 & 1.10.
# Fixed NSFE when buying 'Spawner Boost' upgrade on servers using paperclip 1.12.
# Fixed Placeholders not working for Upgrade messages.
This commit is contained in:
Unknown 2018-11-30 04:16:36 +00:00
parent 5e47f8b108
commit 45d8527ebc
210 changed files with 159 additions and 211 deletions

View File

@ -1,26 +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="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<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$/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: be.maximvdw:placeholderapi:2.5.1" level="project" />
<orderEntry type="library" name="Maven: me.clip:placeholderapi:2.5.1" level="project" />
<orderEntry type="library" name="Maven: org.spigotmc:spigot:1.13.2" level="project" />
</component>
</module>

59
pom.xml
View File

@ -1,55 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"> <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">
<groupId>com.songoda</groupId> <modelVersion>4.0.0</modelVersion>
<artifactId>Skyblock</artifactId> <groupId>com.songoda</groupId>
<modelVersion>4.0.0</modelVersion> <artifactId>SkyBlock</artifactId>
<version>32</version> <version>32</version>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
<version>3.6.1</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<sourceDirectory>src</sourceDirectory>
</build>
<repositories>
<repository>
<id>private</id>
<url>http://repo.songoda.com/repository/private</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>be.maximvdw</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>net.milkbowl</groupId>
<artifactId>vault</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.13.2</version>
</dependency>
</dependencies>
</project> </project>

View File

@ -52,7 +52,7 @@ import me.goodandevil.skyblock.world.generator.VoidGenerator;
public class SkyBlock extends JavaPlugin { public class SkyBlock extends JavaPlugin {
private static SkyBlock instance; private static SkyBlock instance;
private FileManager fileManager; private FileManager fileManager;
private WorldManager worldManager; private WorldManager worldManager;
private VisitManager visitManager; private VisitManager visitManager;
@ -73,15 +73,11 @@ public class SkyBlock extends JavaPlugin {
private LeaderboardManager leaderboardManager; private LeaderboardManager leaderboardManager;
private MessageManager messageManager; private MessageManager messageManager;
private EconomyManager economyManager; private EconomyManager economyManager;
@Override @Override
public void onEnable() { public void onEnable() {
instance = this; instance = this;
if (!isEnable()) {
return;
}
fileManager = new FileManager(this); fileManager = new FileManager(this);
worldManager = new WorldManager(this); worldManager = new WorldManager(this);
visitManager = new VisitManager(this); visitManager = new VisitManager(this);
@ -90,33 +86,33 @@ public class SkyBlock extends JavaPlugin {
upgradeManager = new UpgradeManager(this); upgradeManager = new UpgradeManager(this);
creationManager = new CreationManager(this); creationManager = new CreationManager(this);
playerDataManager = new PlayerDataManager(this); playerDataManager = new PlayerDataManager(this);
if (fileManager.getConfig(new File(getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Scoreboard.Enable")) { if (fileManager.getConfig(new File(getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Scoreboard.Enable")) {
scoreboardManager = new ScoreboardManager(this); scoreboardManager = new ScoreboardManager(this);
} }
inviteManager = new InviteManager(this); inviteManager = new InviteManager(this);
biomeManager = new BiomeManager(this); biomeManager = new BiomeManager(this);
levellingManager = new LevellingManager(this); levellingManager = new LevellingManager(this);
commandManager = new CommandManager(this); commandManager = new CommandManager(this);
structureManager = new StructureManager(this); structureManager = new StructureManager(this);
soundManager = new SoundManager(this); soundManager = new SoundManager(this);
if (fileManager.getConfig(new File(getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Generator.Enable")) { if (fileManager.getConfig(new File(getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Generator.Enable")) {
generatorManager = new GeneratorManager(this); generatorManager = new GeneratorManager(this);
} }
placeholderManager = new PlaceholderManager(this); placeholderManager = new PlaceholderManager(this);
placeholderManager.registerPlaceholders(); placeholderManager.registerPlaceholders();
leaderboardManager = new LeaderboardManager(this); leaderboardManager = new LeaderboardManager(this);
messageManager = new MessageManager(this); messageManager = new MessageManager(this);
economyManager = new EconomyManager(); economyManager = new EconomyManager();
new PlaytimeTask(playerDataManager, islandManager).runTaskTimerAsynchronously(this, 0L, 20L); new PlaytimeTask(playerDataManager, islandManager).runTaskTimerAsynchronously(this, 0L, 20L);
new VisitTask(playerDataManager).runTaskTimerAsynchronously(this, 0L, 20L); new VisitTask(playerDataManager).runTaskTimerAsynchronously(this, 0L, 20L);
new ConfirmationTask(playerDataManager).runTaskTimerAsynchronously(this, 0L, 20L); new ConfirmationTask(playerDataManager).runTaskTimerAsynchronously(this, 0L, 20L);
PluginManager pluginManager = getServer().getPluginManager(); PluginManager pluginManager = getServer().getPluginManager();
pluginManager.registerEvents(new Join(this), this); pluginManager.registerEvents(new Join(this), this);
pluginManager.registerEvents(new Quit(this), this); pluginManager.registerEvents(new Quit(this), this);
@ -134,136 +130,132 @@ public class SkyBlock extends JavaPlugin {
pluginManager.registerEvents(new Respawn(this), this); pluginManager.registerEvents(new Respawn(this), this);
pluginManager.registerEvents(new Chat(this), this); pluginManager.registerEvents(new Chat(this), this);
pluginManager.registerEvents(new Spawner(this), this); pluginManager.registerEvents(new Spawner(this), this);
pluginManager.registerEvents(new Rollback(), this); pluginManager.registerEvents(new Rollback(), this);
pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Levelling(), this); pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Levelling(), this);
pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Creator(), this); pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Creator(), this);
pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Settings(), this); pluginManager.registerEvents(new me.goodandevil.skyblock.menus.admin.Settings(), this);
pluginManager.registerEvents(new Generator(), this); pluginManager.registerEvents(new Generator(), this);
} }
@Override @Override
public void onDisable() { public void onDisable() {
if (this.levellingManager != null) { if (this.levellingManager != null) {
this.levellingManager.onDisable(); this.levellingManager.onDisable();
} }
if (this.islandManager != null) { if (this.islandManager != null) {
this.islandManager.onDisable(); this.islandManager.onDisable();
} }
if (this.visitManager != null) { if (this.visitManager != null) {
this.visitManager.onDisable(); this.visitManager.onDisable();
} }
if (this.banManager != null) { if (this.banManager != null) {
this.banManager.onDisable(); this.banManager.onDisable();
} }
if (this.biomeManager != null) { if (this.biomeManager != null) {
this.biomeManager.onDisable(); this.biomeManager.onDisable();
} }
if (this.creationManager != null) { if (this.creationManager != null) {
this.creationManager.onDisable(); this.creationManager.onDisable();
} }
if (this.playerDataManager != null) { if (this.playerDataManager != null) {
this.playerDataManager.onDisable(); this.playerDataManager.onDisable();
} }
} }
public static SkyBlock getInstance() { public static SkyBlock getInstance() {
return instance; return instance;
} }
public FileManager getFileManager() { public FileManager getFileManager() {
return fileManager; return fileManager;
} }
public WorldManager getWorldManager() { public WorldManager getWorldManager() {
return worldManager; return worldManager;
} }
public VisitManager getVisitManager() { public VisitManager getVisitManager() {
return visitManager; return visitManager;
} }
public BanManager getBanManager() { public BanManager getBanManager() {
return banManager; return banManager;
} }
public IslandManager getIslandManager() { public IslandManager getIslandManager() {
return islandManager; return islandManager;
} }
public UpgradeManager getUpgradeManager() { public UpgradeManager getUpgradeManager() {
return upgradeManager; return upgradeManager;
} }
public CreationManager getCreationManager() { public CreationManager getCreationManager() {
return creationManager; return creationManager;
} }
public PlayerDataManager getPlayerDataManager() { public PlayerDataManager getPlayerDataManager() {
return playerDataManager; return playerDataManager;
} }
public ScoreboardManager getScoreboardManager() { public ScoreboardManager getScoreboardManager() {
return scoreboardManager; return scoreboardManager;
} }
public InviteManager getInviteManager() { public InviteManager getInviteManager() {
return inviteManager; return inviteManager;
} }
public BiomeManager getBiomeManager() { public BiomeManager getBiomeManager() {
return biomeManager; return biomeManager;
} }
public LevellingManager getLevellingManager() { public LevellingManager getLevellingManager() {
return levellingManager; return levellingManager;
} }
public CommandManager getCommandManager() { public CommandManager getCommandManager() {
return commandManager; return commandManager;
} }
public StructureManager getStructureManager() { public StructureManager getStructureManager() {
return structureManager; return structureManager;
} }
public SoundManager getSoundManager() { public SoundManager getSoundManager() {
return soundManager; return soundManager;
} }
public GeneratorManager getGeneratorManager() { public GeneratorManager getGeneratorManager() {
return generatorManager; return generatorManager;
} }
public PlaceholderManager getPlaceholderManager() { public PlaceholderManager getPlaceholderManager() {
return placeholderManager; return placeholderManager;
} }
public LeaderboardManager getLeaderboardManager() { public LeaderboardManager getLeaderboardManager() {
return leaderboardManager; return leaderboardManager;
} }
public MessageManager getMessageManager() { public MessageManager getMessageManager() {
return messageManager; return messageManager;
} }
public EconomyManager getEconomyManager() { public EconomyManager getEconomyManager() {
return economyManager; return economyManager;
} }
public boolean isEnable() { @Override
return false; public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return new VoidGenerator();
} }
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return new VoidGenerator();
}
} }

View File

@ -0,0 +1,78 @@
package me.goodandevil.skyblock.command.commands;
import java.io.File;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import me.goodandevil.skyblock.SkyBlock;
import me.goodandevil.skyblock.command.CommandManager;
import me.goodandevil.skyblock.command.SubCommand;
import me.goodandevil.skyblock.command.CommandManager.Type;
import me.goodandevil.skyblock.menus.Visit;
import me.goodandevil.skyblock.message.MessageManager;
import me.goodandevil.skyblock.playerdata.PlayerData;
import me.goodandevil.skyblock.sound.SoundManager;
import me.goodandevil.skyblock.utils.version.Sounds;
public class VisitCommand extends SubCommand {
private final SkyBlock skyblock;
private String info;
public VisitCommand(SkyBlock skyblock) {
this.skyblock = skyblock;
}
@Override
public void onCommand(Player player, String[] args) {
MessageManager messageManager = skyblock.getMessageManager();
SoundManager soundManager = skyblock.getSoundManager();
if (args.length == 0) {
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
playerData.setType(Visit.Type.Default);
playerData.setSort(Visit.Sort.Default);
Visit.getInstance().open(player, (Visit.Type) playerData.getType(), (Visit.Sort) playerData.getSort());
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
} else if (args.length == 1) {
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
@Override
public void run() {
Bukkit.getServer().dispatchCommand(player, "island teleport " + args[0]);
}
});
} else {
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Visit.Invalid.Message"));
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
}
}
@Override
public String getName() {
return "visit";
}
@Override
public String getInfo() {
return info;
}
@Override
public SubCommand setInfo(String info) {
this.info = info;
return this;
}
@Override
public String[] getAliases() {
return new String[0];
}
@Override
public Type getType() {
return CommandManager.Type.Default;
}
}

Some files were not shown because too many files have changed in this diff Show More