Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aroma1997.backup.api;
- import java.io.File;
- import java.util.Map.Entry;
- import java.util.Set;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.fml.common.eventhandler.Event;
- /**
- * Base class for all BackupEvents. To receive these events, create an
- * EventListener registered to {@link MinecraftForge#EVENT_BUS}
- *
- * @author Aroma1997
- */
- public abstract class BackupEvent extends Event {
- private BackupEvent() {
- }
- /**
- * This event is fired when a backup is done. To be more precise: after the
- * level-saving is turned off, but before the world is actually saved.
- */
- public static class BackupStartEvent extends BackupEvent {
- /**
- * This set contains additional files to be backed up. If you want to
- * put any additional files into the backup.zip file, just add an Entry
- * here. The key of the {@link Entry} is the {@link File#} on the hard
- * drive. The value of the {@link Entry} is the path inside of the
- * backup.zip file. Note: All additional files will be in the
- * "additionalfiles" subfolder in the backup.zip Also note: This set
- * does not support removing entries from it.
- */
- public final Set<Entry<File, String>> list;
- public BackupStartEvent(Set<Entry<File, String>> list) {
- super();
- this.list = list;
- }
- }
- /**
- * This event is fired after the backup is done.
- * Node: this event is posted on the BackupThread. Make sure to use synchronization, if you need to interact with the world.
- */
- public static class BackupDoneEvent extends BackupEvent {
- /**
- * The backup file.
- */
- public final File backup;
- public BackupDoneEvent(File backup) {
- super();
- this.backup = backup;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement