Some changes. Slowly approaching forge....
parent
6c2715f652
commit
73bee53ee7
12
build.gradle
12
build.gradle
|
@ -13,9 +13,9 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.0'
|
||||
group = 'net.szum123321.TextileBackup' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'textile_backup'
|
||||
version = '1.1.1-1.14.4'
|
||||
group = 'szum123321.textile_backup' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'textile_backup[FORGE]'
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
|
@ -117,12 +117,12 @@ dependencies {
|
|||
jar {
|
||||
manifest {
|
||||
attributes([
|
||||
"Specification-Title": "examplemod",
|
||||
"Specification-Vendor": "examplemodsareus",
|
||||
"Specification-Title": "Textile Backup",
|
||||
"Specification-Vendor": "Szum123321",
|
||||
"Specification-Version": "1", // We are version 1 of ourselves
|
||||
"Implementation-Title": project.name,
|
||||
"Implementation-Version": "${version}",
|
||||
"Implementation-Vendor" :"examplemodsareus",
|
||||
"Implementation-Vendor" :"Szum123321",
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
])
|
||||
}
|
||||
|
|
|
@ -65,19 +65,18 @@ public class ConfigHandler {
|
|||
public static ConfigData loadConfig(){
|
||||
File configFile = getConfigFile();
|
||||
|
||||
if(!configFile.exists()) {
|
||||
TextileBackup.logger.info("Creating new config file");
|
||||
if(!configFile.exists())
|
||||
saveConfig(new ConfigData());
|
||||
}
|
||||
|
||||
try {
|
||||
Jankson jankson = Jankson.builder().build();
|
||||
return jankson.fromJson(jankson.load(configFile), ConfigData.class);
|
||||
} catch (IOException | SyntaxError e) {
|
||||
} catch (IOException e) {
|
||||
TextileBackup.logger.error(e.getMessage());
|
||||
} catch(SyntaxError e) {
|
||||
TextileBackup.logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
TextileBackup.logger.info("Loading default config!");
|
||||
return new ConfigData();
|
||||
}
|
||||
|
||||
|
|
|
@ -46,12 +46,10 @@ public class TextileBackup {
|
|||
}
|
||||
|
||||
public void setup(FMLCommonSetupEvent event){
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
MinecraftForge.EVENT_BUS.register(ServerBackupScheduler.class);
|
||||
|
||||
config = ConfigHandler.loadConfig();
|
||||
logger.info("Now");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -32,13 +32,10 @@ public class ServerBackupScheduler {
|
|||
@SubscribeEvent
|
||||
public static void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if(event.phase == TickEvent.Phase.START) {
|
||||
TextileBackup.logger.info("Diiff: " + (System.currentTimeMillis() - lastBackupTime));
|
||||
if(System.currentTimeMillis() - lastBackupTime >= TextileBackup.config.backupInterval * 1000) {
|
||||
if(server.getPlayerList().getCurrentPlayerCount() > 0 || TextileBackup.config.doBackupsOnEmptyServer)
|
||||
BackupHelper.create(server, null, true, null);
|
||||
|
||||
TextileBackup.logger.info("Time: " + lastBackupTime);
|
||||
|
||||
lastBackupTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
@ -48,9 +45,6 @@ public class ServerBackupScheduler {
|
|||
public static void onServerStarted(FMLServerStartingEvent event) {
|
||||
server = event.getServer();
|
||||
lastBackupTime = System.currentTimeMillis();
|
||||
|
||||
TextileBackup.logger.info("Server Starting at: " + lastBackupTime);
|
||||
TextileBackup.logger.info("Interval is: " + TextileBackup.config.backupInterval);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
modLoader="javafml" #mandatory
|
||||
loaderVersion="[28,)" #mandatory (28 is current forge version)
|
||||
issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
issueTrackerURL="https://github.com/Szum123321/textile_backup/issues" #optional
|
||||
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId="textile_backup" #mandatory
|
||||
version="${file.jarVersion}" #mandatory
|
||||
version="[Forge]1.1.1-1.14.4" #mandatory
|
||||
displayName="Textile Backup" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
displayURL="http://example.com/" #optional
|
||||
logoFile="examplemod.png" #optional
|
||||
credits="Thanks for this example mod goes to Java" #optional
|
||||
displayURL="https://www.curseforge.com/minecraft/mc-mods/textile-backup" #optional
|
||||
logoFile="textile_backup.png" #optional
|
||||
credits="Made on request of one of curseforge users" #optional
|
||||
authors="Szum123321" #optional
|
||||
description='''
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.4 MiB |
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/textile-backup",
|
||||
"promos": {
|
||||
"1.14.4-latest": "1.1.1-1.14.4",
|
||||
"1.14.4-recommended": "1.1.1-1.14.4"
|
||||
},
|
||||
"1.14.4": {
|
||||
"1.1.1": "Initial release for forge"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue