Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Spazzinq committed Jan 6, 2024
1 parent 8b5efbd commit cff351a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public void onEnable() {
}

private void registerManagers() {
boolean isNewSpigotAPI = false;
boolean isNewSpigotAPI = true;

for (int i = 13; i < 21; i++) {
for (int i = 8; i < 13; i++) {
if (getServer().getBukkitVersion().contains("1." + i)) {
isNewSpigotAPI = true;
isNewSpigotAPI = false;
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.spazzinq.flightcontrol.check.always;

import com.craftaro.skyblock.SkyBlock;
import com.craftaro.skyblock.api.SkyBlockAPI;
import com.craftaro.skyblock.api.island.Island;
import com.craftaro.skyblock.api.island.IslandManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
package org.spazzinq.flightcontrol.check.territory.own;

import net.william278.husktowns.api.HuskTownsAPI;
import net.william278.husktowns.chunk.ClaimedChunk;
import net.william278.husktowns.claim.TownClaim;
import net.william278.husktowns.town.Member;
import net.william278.husktowns.town.Town;
import org.bukkit.entity.Player;
import org.spazzinq.flightcontrol.check.territory.TerritoryCheck;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitRunnable;
import org.spazzinq.flightcontrol.FlightControl;
import org.spazzinq.flightcontrol.object.UpdateStatus;
import org.spazzinq.flightcontrol.object.Version;
Expand All @@ -34,7 +32,6 @@

public class UpdateManager {
private static final String PLUGIN_PATH = "plugins/FlightControl.jar";
private static final int MSG_SEND_DELAY_IN_TICKS = 70;

private static UpdateStatus updateStatus = UpdateStatus.UNKNOWN;
private final FlightControl pl;
Expand Down Expand Up @@ -140,7 +137,7 @@ public void fetchSpigotVersion(CommandSender sender) {
});

future.thenAccept(knownHash -> {
updateStatus = UpdateStatus.DOWNLOADED_BUT_NOT_VERIFIED;
updateStatus = UpdateStatus.DOWNLOADED;

try {
// Read the bytes from the file path, then compute a hash
Expand All @@ -156,18 +153,7 @@ public void fetchSpigotVersion(CommandSender sender) {
e.printStackTrace();
}

if (updateStatus == UpdateStatus.VERIFIED) {
if (Bukkit.getPluginManager().isPluginEnabled("Plugman")) {
updateStatus = UpdateStatus.WILL_AUTO_UPDATE;
}
}

sendStatus(sender);

if (updateStatus == UpdateStatus.WILL_AUTO_UPDATE) {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "plugman reload " +
"flightcontrol");
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@

@Getter
public enum UpdateStatus {
UNKNOWN("&e&lFlightControl &7» &eFailed to check for updates. Unknown update status."),
UNKNOWN("&e&lFlightControl &7» &eFailed to check for updates. Check your internet connection?"),
FETCHING_FROM_SPIGOT("&a&lFlightControl &7» &aChecking for updates..."),
NEEDS_UPDATE("&e&lFlightControl &7» &eThere is an update available, but you either disabled automatic " +
"updates or the update is major and requires manual installation. Remember to download and update the " +
"plugin to receive new features and security updates!"),
UP_TO_DATE("&a&lFlightControl &7» &aNo updates found. You're in the clear!"),
DOWNLOADING("&a&lFlightControl &7» &aCurrently downloading an update..."),
DOWNLOADED_BUT_NOT_VERIFIED("&c&lFlightControl &7» &cCould not verify the newly downloaded update is not corrupted!"),
VERIFIED("&a&lFlightControl &7» &aThe update has already been downloaded but cannot install right now. Restart " +
"(or reload) the server to install the update."),
WILL_AUTO_UPDATE("&a&lFlightControl &7» &aAutomatic installation finished! Welcome to a new version of FlightControl.");
DOWNLOADED("&c&lFlightControl &7» &cCould not verify the newly downloaded update is not corrupted!"),
VERIFIED("&a&lFlightControl &7» &aThe update has been downloaded but requires a server restart. Restart " +
"(or reload) the server to install the update.");

private final String message;

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allprojects {
group = 'org.spazzinq'
version = '5.0.0'
version = '5.0.0-BETA'
}

subprojects {
Expand Down
Binary file removed lib/SavageFactions-2.5-RC-9.jar
Binary file not shown.

0 comments on commit cff351a

Please sign in to comment.