Skip to content

Commit

Permalink
all of it moved and that's all you need to know
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Mar 20, 2021
1 parent d6b8e71 commit 0abffbe
Show file tree
Hide file tree
Showing 104 changed files with 85 additions and 71 deletions.
32 changes: 0 additions & 32 deletions AdvancedTP-Bukkit/AdvancedTP-Bukkit.iml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>AdvancedTeleport</artifactId>
<groupId>io.github.niestrat99</groupId>
<version>v5.4.6-SNAPSHOT-2</version>
<version>v5.4.6-SNAPSHOT-3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>AdvancedTP-Bukkit</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions AdvancedTP-Bukkit/pom.xml → AdvancedTeleport-Bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<artifactId>AdvancedTeleport</artifactId>
<groupId>io.github.niestrat99</groupId>
<version>v5.4.6-SNAPSHOT-2</version>
<version>v5.4.6-SNAPSHOT-3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

<artifactId>AdvancedTP-Bukkit</artifactId>
<artifactId>AdvancedTeleport-Bukkit</artifactId>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class ATPlayer {

private static final HashMap<String, ATPlayer> players = new HashMap<>();

/**
*
* @param player
*/
public ATPlayer(Player player) {
this(player.getUniqueId(), player.getName());
}
Expand Down Expand Up @@ -114,9 +118,10 @@ public void setTeleportationEnabled(boolean teleportationEnabled, SQLManager.SQL
*/

/**
* Checks to see if this player has blocked a specified player.
*
* @param otherPlayer
* @return
* @param otherPlayer The player that this one theoretically blocked.
* @return true is otherPlayer is blocked, false if otherwise.
*/
public boolean hasBlocked(OfflinePlayer otherPlayer) {
return blockedUsers.containsKey(otherPlayer.getUniqueId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static HashMap<String, Warp> getWarps() {
}

public void delete(SQLManager.SQLCallback<Boolean> callback) {
warps.remove(name);
WarpSQLManager.get().removeWarp(name, callback);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
BukkitRunnable run = new BukkitRunnable() {
@Override
public void run() {
CustomMessages.sendMessage(sender, "Error.requestExpired", "{player}", target.getName());
if (NewConfig.get().NOTIFY_ON_EXPIRE.get()) {
CustomMessages.sendMessage(sender, "Error.requestExpired", "{player}", target.getName());
}
TPRequest.removeRequest(TPRequest.getRequestByReqAndResponder(target, player));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
BukkitRunnable run = new BukkitRunnable() {
@Override
public void run() {
CustomMessages.sendMessage(sender, "Error.requestExpired", "{player}", target.getName());
if (NewConfig.get().NOTIFY_ON_EXPIRE.get()) {
CustomMessages.sendMessage(sender, "Error.requestExpired", "{player}", target.getName());
}
TPRequest.removeRequest(TPRequest.getRequestByReqAndResponder(target, player));
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.niestrat99.advancedteleport.commands.warp;

import io.github.niestrat99.advancedteleport.api.Warp;
import io.github.niestrat99.advancedteleport.commands.AsyncATCommand;
import io.github.niestrat99.advancedteleport.commands.ATCommand;
import io.github.niestrat99.advancedteleport.config.CustomMessages;
import io.github.niestrat99.advancedteleport.sql.WarpSQLManager;
import org.bukkit.Location;
Expand All @@ -13,7 +13,7 @@

import java.util.List;

public class SetWarpCommand extends AbstractWarpCommand implements AsyncATCommand {
public class SetWarpCommand extends AbstractWarpCommand implements ATCommand {

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ public class CustomMessages extends CMFile {

public static File ConfigFile = new File(CoreClass.getInstance().getDataFolder(),"custom-messages.yml");
public static CustomMessages config;
private static HashMap<CommandSender, BukkitRunnable> titleManager;

public CustomMessages(Plugin plugin) {
super(plugin, "custom-messages");
setDescription(null);
config = this;
titleManager = new HashMap<>();
}

public void loadDefaults() {
Expand All @@ -44,6 +46,10 @@ public void loadDefaults() {
addDefault("Teleport.eventBeforeTPMovementAllowed" , "&b↑ &8» &7Teleporting in &b{countdown} seconds&7!");
addDefault("Teleport.eventTeleport" , "&b↑ &8» &7Teleporting...");
addDefault("Teleport.eventMovement" , "&b↑ &8» &7Teleport has been cancelled due to movement.");
addDefault("Teleport.eventMovement_title.length", 60);
addDefault("Teleport.eventMovement_title.fade-in", 0);
addDefault("Teleport.eventMovement_title.fade-out", 10);
addDefault("Teleport.eventMovement_title.0", "&e&l! &c&lCancelled &e&l!");
addDefault("Teleport.teleportingToSpawn", "&b↑ &8» &7Teleporting you to spawn!");
addDefault("Teleport.teleporting", "&b↑ &8» &7Teleporting to &b{player}&7!");
addDefault("Teleport.teleportingToHome", "&b↑ &8» &7Teleporting to &b{home}&7!");
Expand Down Expand Up @@ -90,34 +96,34 @@ public void loadDefaults() {
addDefault("Error.noBedHomeOther", "&b↑ &8» &b{player} &7doesn't have a bed spawn set!");
addDefault("Error.reachedHomeLimit", "&b↑ &8» &7You can't set any more homes!");
addDefault("Error.homeAlreadySet", "&b↑ &8» &7You already have a home called &b{home}&7!");
config.addDefault("Error.noWarpInput", "&b↑ &8» &7You have to include the warp's name!");
config.addDefault("Error.noSuchWarp", "&b↑ &8» &7That warp doesn't exist!");
config.addDefault("Error.noSuchWorld", "&b↑ &8» &7That world doesn't exist!");
config.addDefault("Error.noLocation", "&b↑ &8» &7You don't have any location to teleport back to!");
config.addDefault("Error.notAPlayer", "&b↑ &8» &7You must be a player to run this command!");
addDefault("Error.noWarpInput", "&b↑ &8» &7You have to include the warp's name!");
addDefault("Error.noSuchWarp", "&b↑ &8» &7That warp doesn't exist!");
addDefault("Error.noSuchWorld", "&b↑ &8» &7That world doesn't exist!");
addDefault("Error.noLocation", "&b↑ &8» &7You don't have any location to teleport back to!");
addDefault("Error.notAPlayer", "&b↑ &8» &7You must be a player to run this command!");
config.addDefault("Error.noHomes", "&b↑ &8» &7You haven't got any homes!");
config.addDefault("Error.noHomesOtherPlayer", "&b↑ &8» &b{player} &7hasn't got any homes!");
config.addDefault("Error.tooFarAway", "&b↑ &8» &7The teleport destination is too far away so you can not teleport there!");
config.addDefault("Error.noRequestsSent", "&b↑ &8» &7Couldn't send a request to anyone :(");
config.addDefault("Error.onCountdown","&b↑ &8» &7You can't use this command whilst waiting to teleport!");
config.addDefault("Error.noPermissionWarp", "&b↑ &8» &7You can't warp to &b{warp}&7!");
config.addDefault("Error.cantTPToWorld", "&b↑ &8» &7You can't randomly teleport in that world!");
addDefault("Error.cantTPToWorld", "&b↑ &8» &7You can't randomly teleport in that world!");
// config.addDefault("Error.invalidName", "&cHomes and warps may only have letters and numbers in the names!");
config.addDefault("Error.cantTPToWorldLim", "&b↑ &8» &7You can't teleport to &b{world}&7!");
config.addDefault("Error.tooFewArguments", "&b↑ &8» &7Too few arguments!");
config.addDefault("Error.invalidArgs", "&b↑ &8» &7Invalid arguments!");
config.addDefault("Error.cantTPToPlayer", "&b↑ &8» &7You can't request a teleportation to &b{player}&7!");
config.addDefault("Error.noWarps", "&b↑ &8» &7There are no warps as of currently!");
config.addDefault("Error.noAccessHome", "&b↑ &8» &7You cannot access &b{home}&7 as of currently!");
config.addDefault("Error.moveHomeFail", "&b↑ &8» &7The home has been moved but the data has not been stored successfully. The plugin will try to fix this itself.");
config.addDefault("Error.setMainHomeFail", "&b↑ &8» &7The main home has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
config.addDefault("Error.deleteHomeFail", "&b↑ &8» &7The home has been deleted but the data has not been stored successfully. The plugin will try to fix this itself.");
config.addDefault("Error.setHomeFail", "&b↑ &8» &7The home has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
config.addDefault("Error.deleteWarpFail", "&b↑ &8» &7The warp has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
config.addDefault("Error.homesNotLoaded", "&b↑ &8» &7Homes for this player haven't loaded yet, please wait a little bit (even just a second) before trying this again!");
config.addDefault("Error.noOfflineLocation", "&b↑ &8» &7No offline location was found for &b{player}&7!");
config.addDefault("Error.failedOfflineTeleport", "&b↑ &8» &7Failed to teleport to offline player &b{player}&7!");
config.addDefault("Error.failedOfflineTeleportHere", "&b↑ &8» &7Failed to teleport offline player &b{player} &7 to your location!");
addDefault("Error.cantTPToWorldLim", "&b↑ &8» &7You can't teleport to &b{world}&7!");
addDefault("Error.tooFewArguments", "&b↑ &8» &7Too few arguments!");
addDefault("Error.invalidArgs", "&b↑ &8» &7Invalid arguments!");
addDefault("Error.cantTPToPlayer", "&b↑ &8» &7You can't request a teleportation to &b{player}&7!");
addDefault("Error.noWarps", "&b↑ &8» &7There are no warps as of currently!");
addDefault("Error.noAccessHome", "&b↑ &8» &7You cannot access &b{home}&7 as of currently!");
addDefault("Error.moveHomeFail", "&b↑ &8» &7The home has been moved but the data has not been stored successfully. The plugin will try to fix this itself.");
addDefault("Error.setMainHomeFail", "&b↑ &8» &7The main home has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
addDefault("Error.deleteHomeFail", "&b↑ &8» &7The home has been deleted but the data has not been stored successfully. The plugin will try to fix this itself.");
addDefault("Error.setHomeFail", "&b↑ &8» &7The home has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
addDefault("Error.deleteWarpFail", "&b↑ &8» &7The warp has been set but the data has not been stored successfully. The plugin will try to fix this itself.");
addDefault("Error.homesNotLoaded", "&b↑ &8» &7Homes for this player haven't loaded yet, please wait a little bit (even just a second) before trying this again!");
addDefault("Error.noOfflineLocation", "&b↑ &8» &7No offline location was found for &b{player}&7!");
addDefault("Error.failedOfflineTeleport", "&b↑ &8» &7Failed to teleport to offline player &b{player}&7!");
addDefault("Error.failedOfflineTeleportHere", "&b↑ &8» &7Failed to teleport offline player &b{player} &7 to your location!");
addDefault("Error.alreadySearching", "&b↑ &8» &7Already searching for a location to teleport to!");

config.addDefault("Info.tpOff", "&b↑ &8» &7Successfully disabled teleport requests!");
Expand Down Expand Up @@ -152,6 +158,7 @@ public void loadDefaults() {
config.addDefault("Info.multipleRequestDeny", "&b↑ &8» &7You have multiple teleport requests pending! Click one of the following to deny:");
config.addDefault("Info.requestDeclined", "&b↑ &8» &7You've declined the teleport request!");
config.addDefault("Info.requestDeclinedResponder", "&b↑ &8» &b{player} &7has declined your teleport request!");
config.addDefault("Info.requestDisplaced", "&b↑ &8» &7Your request has been cancelled because &b{player} &7got another request!");

config.addDefault("Info.deletedHome", "&b↑ &8» &7Successfully deleted the home &b{home}&7!");
config.addDefault("Info.deletedHomeOther", "&b↑ &8» &7Successfully deleted the home &b{home} &7for &b{player}&7!");
Expand Down Expand Up @@ -289,15 +296,15 @@ public static void sendMessage(CommandSender sender, String path, String... plac
titleInfo[2] = titles.getInt("fade-out");
}

new BukkitRunnable() {
BukkitRunnable runnable = new BukkitRunnable() {

private int current = 0;
private String previousTitle = null;
private String previousSubtitle = null;

@Override
public void run() {
if (current == titleInfo[1]) {
if (current == titleInfo[1] || titleManager.get(player) != this) {
cancel();
return;
}
Expand All @@ -318,7 +325,9 @@ public void run() {

current++;
}
}.runTaskTimer(CoreClass.getInstance(), 1, 1);
};
titleManager.put(player, runnable);
runnable.runTaskTimer(CoreClass.getInstance(), 1, 1);
}
}
if (config.getConfig().get(path) instanceof List) {
Expand Down
Loading

0 comments on commit 0abffbe

Please sign in to comment.