Advertisement
Guest User

Untitled

a guest
Jun 11th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. package aroma1997.backup.api;
  2.  
  3. import java.io.File;
  4. import java.util.Map.Entry;
  5. import java.util.Set;
  6.  
  7. import net.minecraftforge.common.MinecraftForge;
  8. import net.minecraftforge.fml.common.eventhandler.Event;
  9.  
  10. /**
  11. * Base class for all BackupEvents. To receive these events, create an
  12. * EventListener registered to {@link MinecraftForge#EVENT_BUS}
  13. *
  14. * @author Aroma1997
  15. */
  16. public abstract class BackupEvent extends Event {
  17. private BackupEvent() {
  18. }
  19.  
  20. /**
  21. * This event is fired when a backup is done. To be more precise: after the
  22. * level-saving is turned off, but before the world is actually saved.
  23. */
  24. public static class BackupStartEvent extends BackupEvent {
  25. /**
  26. * This set contains additional files to be backed up. If you want to
  27. * put any additional files into the backup.zip file, just add an Entry
  28. * here. The key of the {@link Entry} is the {@link File#} on the hard
  29. * drive. The value of the {@link Entry} is the path inside of the
  30. * backup.zip file. Note: All additional files will be in the
  31. * "additionalfiles" subfolder in the backup.zip Also note: This set
  32. * does not support removing entries from it.
  33. */
  34. public final Set<Entry<File, String>> list;
  35.  
  36. public BackupStartEvent(Set<Entry<File, String>> list) {
  37. super();
  38. this.list = list;
  39. }
  40. }
  41.  
  42. /**
  43. * This event is fired after the backup is done.
  44. * Node: this event is posted on the BackupThread. Make sure to use synchronization, if you need to interact with the world.
  45. */
  46. public static class BackupDoneEvent extends BackupEvent {
  47.  
  48. /**
  49. * The backup file.
  50. */
  51. public final File backup;
  52.  
  53. public BackupDoneEvent(File backup) {
  54. super();
  55. this.backup = backup;
  56. }
  57. }
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement