Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
92d2e7e
Organise imports
Derkades Jun 8, 2017
7cb8fbc
Remove bukkit API (spigot API includes bukkit)
Derkades Jun 8, 2017
d590eee
Better formatting of pom.xml
Derkades Jun 8, 2017
8d7983b
Remove / (why was this here in the first place?)
Derkades Jun 8, 2017
a2ccc89
Update to non-deprecated methods
Derkades Jun 8, 2017
efb7181
Ignore eclipse project files
Derkades Jun 8, 2017
b4bdc61
You don't need to check for command name
Derkades Jun 8, 2017
afc70cd
Send a message if the sender doesn't have permission
Derkades Jun 8, 2017
854cc8e
Update readme
Derkades Jun 8, 2017
5a625d1
Return false instead of sending message
Derkades Jun 8, 2017
f68ca20
Convert indentations to spaces
Derkades Jun 8, 2017
c1ac079
Remove unused import
Derkades Jun 8, 2017
5560a25
Move return true for better readability
Derkades Jun 8, 2017
48a73c7
Remove manifest file
Derkades Jun 8, 2017
0c44ed3
ammmmmmounts
Derkades Jun 8, 2017
3847319
Add backup prefix config option
Derkades Aug 13, 2019
d7aed86
Update branding
Derkades Aug 13, 2019
78cd51c
Target java 8
Derkades Aug 13, 2019
40096ab
Reorganising and formatting
Derkades Aug 13, 2019
07f7902
Use bukkit scheduler instead of java threads
Derkades Aug 13, 2019
0649b58
Move to util package
Derkades Aug 13, 2019
d09439e
Put comments with their options instead of together at the top of the…
Derkades Aug 13, 2019
da6c0f0
Compile against spigot 1.8.8
Derkades Aug 13, 2019
aec977a
Pom formatting and name change
Derkades Aug 13, 2019
8cd7d0e
Print world names instead of world objects
Derkades Aug 13, 2019
a810381
Delete old 'configuring' file
Derkades Aug 22, 2019
84dd638
Load config properly
Derkades Aug 23, 2019
0b33edb
Bump version
Derkades Aug 23, 2019
2eadd8f
Bump maven-compiler-plugin from 2.3.2 to 3.8.1
dependabot-preview[bot] Jul 26, 2020
48b63dc
Merge pull request #1 from Derkades/dependabot/maven/org.apache.maven…
Derkades Jul 26, 2020
fd0aa8d
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 28, 2021
787aede
Merge pull request #2 from Derkades/dependabot/add-v2-config-file
Derkades Apr 29, 2021
04fbea8
Bump maven-compiler-plugin from 3.8.1 to 3.9.0
dependabot[bot] Jan 13, 2022
c9f9e88
Merge pull request #3 from Derkades/dependabot/maven/org.apache.maven…
Derkades Jan 13, 2022
5aef2f2
Bump maven-compiler-plugin from 3.9.0 to 3.10.0
dependabot[bot] Feb 15, 2022
33646ff
Merge pull request #4 from Derkades/dependabot/maven/org.apache.maven…
Derkades Feb 15, 2022
43e9b96
Bump maven-compiler-plugin from 3.10.0 to 3.10.1
dependabot[bot] Mar 11, 2022
19d15d9
Bump maven-compiler-plugin from 3.10.1 to 3.11.0
dependabot[bot] Feb 28, 2023
7f5311e
Bump org.apache.maven.plugins:maven-compiler-plugin (#7)
dependabot[bot] Dec 19, 2023
471c240
Bump org.apache.maven.plugins:maven-compiler-plugin (#8)
dependabot[bot] Dec 27, 2023
73462ca
Bump org.apache.maven.plugins:maven-compiler-plugin (#9)
dependabot[bot] Mar 21, 2024
f236934
Bump org.apache.maven.plugins:maven-compiler-plugin (#10)
dependabot[bot] Feb 24, 2025
2f258d3
Bump org.apache.maven.plugins:maven-compiler-plugin (#12)
dependabot[bot] Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
Thumbs.db
/bin/

.classpath
*.project
.settings/org.eclipse.jdt.core.prefs
*.prefs
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*CURRENT BUILD: Bukkit 1.10.x
CURRENT BUILD: Bukkit 1.12
================================
**Should work on 1.7-1.12**

Since simple save is no longer available, I was looking for a nice simple way to back up my server maps with minimal configuration. Just set the folder and the interval, and your away. Most of the plugins I found had too many features for such a simple task (in my own opinion) so I decided to create this little plugin.

Expand Down
94 changes: 46 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.exolius.simplebackup</groupId>
<artifactId>SimpleBackup</artifactId>
<version>1.8</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--Spigot API-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.11.2-R0.1-SNAPSHOT/</version>
<scope>provided</scope>
</dependency>
<!--Bukkit API-->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.11.2-R0.1-SNAPSHOT/</version>
<scope>provided</scope>
</dependency>
</dependencies>
<modelVersion>4.0.0</modelVersion>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh what happened here, did you like change spaces to tabs or something?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh woops, that's happens automatically.. I'll convert tabs back to spaces

<groupId>com.exolius.simplebackup</groupId>
<artifactId>SimpleBackup</artifactId>
<version>1.8</version>
<build>
<sourceDirectory>src</sourceDirectory>

<resources>
<resource>
<directory>src</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<!--Spigot API-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
23 changes: 12 additions & 11 deletions src/com/exolius/simplebackup/Commands.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.exolius.simplebackup;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
Expand All @@ -16,17 +17,17 @@ public Commands(SimpleBackup plugin) {
--------------------------------------------------------*/
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("sbackup")) {
if (sender.hasPermission("simplebackup.use")) {
new Thread(new Runnable() {
@Override
public void run() {
plugin.doBackup();
}
}).start();
}
return true;
if (sender.hasPermission("simplebackup.use")) {
new Thread(new Runnable() {
@Override
public void run() {
plugin.doBackup();
}
}).start();
} else {
sender.sendMessage(ChatColor.RED + "You don't have permission to execute this command.");
}
return false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're aware that returning false prints the usage message in plugin.yml, and if the player doesn't have permission, that can also be specified in the plugin.yml. Albeit he doesn't use it for the latter purpose, I don't really see the need to tell a player they don't have permission for a simple command like this (which the player shouldn't know about anyways...)

Feels more like a customization thing anyways.


return true;
}
}
10 changes: 7 additions & 3 deletions src/com/exolius/simplebackup/DeleteSchedule.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.exolius.simplebackup;

import java.io.File;
import java.io.IOException;
import java.text.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down
8 changes: 7 additions & 1 deletion src/com/exolius/simplebackup/SimpleBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ private Collection<World> worldsForBackup() {
}

private double hoursOf(Date parsedTime) {
return parsedTime.getHours() + parsedTime.getMinutes() / 60. + parsedTime.getSeconds() / 3600.;
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(parsedTime);
int hours = calendar.get(Calendar.HOUR_OF_DAY);
int minutes = calendar.get(Calendar.MINUTE);
int seconds = calendar.get(Calendar.SECOND);

return hours + minutes / 60. + seconds / 3600.;
}

private long syncStart(double startHour) {
Expand Down