Skip to content

Commit

Permalink
new archetype
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamesuta committed Nov 3, 2018
1 parent 1484077 commit 798ae7f
Show file tree
Hide file tree
Showing 80 changed files with 3,586 additions and 3,622 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ common/*

# allow any
!*.md
!src/
!LICENSE
!sources/
!gradle/
!lib/
!info/
!build.gradle
!common.gradle
!build.subprojects.gradle
!project.gradle
!settings.gradle
!gradle.properties
Expand Down
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_install:
install: "./gradlew setupCIWorkspace --continue"
script: "./gradlew build --continue"
after_success:
- ./gradlew githubRelease curseforge --continue
- ./gradlew githubRelease curseforge bintrayUpload --continue
#- ./gradlew githubRelease --continue
#- ./gradlew bintrayUpload --continue
before_cache:
Expand All @@ -22,8 +22,4 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
notifications:
email: false
webhooks:
urls:
- secure: "SHLyTtef5pR6tD2t+RoVAeamp8bY7coFFTvITvG5kfmpjaLartudM/cwU7FtDds6BdWiUjqZl9esPshUVXJdv88+NMZoF8HZQD+Rz0M2A4pVh1eEZKzdD0d2OjbCaMzapZgRxyKtjrt5zDJo8G0H1LEMFxcoNLP3JF7nmNeUN+Dmg7QEi54dtLmDF/4rpBJUb1OJ/8E3JXI21GXIWev1e+MZW4Jy3OFYFhpDbcPMxu3JjdsCQMNLW9VQo4dQ2BHngVLMdi0AVwkw4qfd3FqLdZYlbeMnnJUns6UpfClpZZjoCM1OIAxSH4cZXzMO9eONjbtIQGVhSci4FXVodzCBV3KNCnPNIK/wI9O11Y4aFcq4j27nR7HXlxSTWaYXkIu8Ot9RyCVqOfBEFP0/BtFaE9LlTXM0bPq2KEZCMb/fhV0Vp0azeTMdeKGhgxVFclVr0YcplJ1xpYFZGleVSBhqMzVKjZ4GmCWfWCGDsz/XwvEblJfc+Nt5x1bTiuTBn6b72h28r/W55iiV0zUZdNZG1Cx1tcqkOELWJnkgnCHIPBd62NM3D8DgHVH6sgd599/Vl1udincKkSw6IEgilRdAXnu9ogJbimXHatjkjEWXnKSINGUmizqqheA3eRDYL/R7TmGGcnle3gDZ4Zbs2sIJzh5Mbkwp7dLf3hpferjOAG0="
- secure: "TaPOaDHt+rkHB5QBpz0ajwrMB2mmbWnofOFONITqlx+pyP1roq87gDK10+KY8/JqnB1fw+6epcRK+l1R6jzffAdBZzb1c7uaB7DLksHJc8oxFpLcDBArHUonWX82K+4NjVe80pVfwzMX6L9JEaV2xPSxTY1VHRnuc7qhVUk7yMkt9pweSwJu2vzlJLiwLabc2NIkTUQaCaWmEREt0Tb13HZWGEUidoFPKODSAQzByGlkdX6NkJhRmlpSEkhGytvV1QY2I9rO5D9Y3bnfLYRRQ57kHRjbMQe2von31UYYAfkArY4TniogTMJj/pbWsX/v0YFm2Yx/pQsgFkXYwoaDS29isYc6EqSUiQmqOI6bRuXb/5ksn38VhIj4MbVIFKGG6XkV1hzZ3nQ/AQaONmVGIy+IVwmOjZirYRsGuazEFAXp9CTGK6FACk+TCmswEMZOTnVH5w6m9OFLEokmNYCwoHudrEjgGhPT8IlV6MR+WZOYVJgBuO3zMxOe2nk/4nR4ulhtgH/JYGW5KVUK8+eVSc58tN98SgtFpWMK6MqDxrrMB6A41AzkbsMwB+cg99+0ZMTAjrW+2r2HhynnNVJbOW8cv499lV8cdkVg1V0BjZIAJxLb5RedLFSa/5cWViDNqJZuvp288OdSShf4buH0ElhGmAR3tgOoPhGQD2h8TvE="
email: false
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package net.teamfruit.serverobserver;

import javax.annotation.Nonnull;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public interface IProxy {

void preInit(@Nonnull FMLPreInitializationEvent event);

void init(@Nonnull FMLInitializationEvent event);

void postInit(@Nonnull FMLPostInitializationEvent event);

package net.teamfruit.serverobserver;

import javax.annotation.Nonnull;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public interface IProxy {

void preInit(@Nonnull FMLPreInitializationEvent event);

void init(@Nonnull FMLInitializationEvent event);

void postInit(@Nonnull FMLPostInitializationEvent event);

}
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
package net.teamfruit.serverobserver;

import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
import net.minecraftforge.fml.relauncher.Side;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, guiFactory = Reference.GUI_FACTORY)
public class ServerObserver {
@SidedProxy(serverSide = Reference.PROXY_SERVER, clientSide = Reference.PROXY_CLIENT)
private static @Nullable IProxy proxy;

@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}

@EventHandler
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
if (proxy!=null)
proxy.preInit(event);
}

@EventHandler
public void init(final @Nonnull FMLInitializationEvent event) {
if (proxy!=null)
proxy.init(event);
}

@EventHandler
public void postInit(final @Nonnull FMLPostInitializationEvent event) {
if (proxy!=null)
proxy.postInit(event);
}
}
package net.teamfruit.serverobserver;

import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
import net.minecraftforge.fml.relauncher.Side;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, guiFactory = Reference.GUI_FACTORY)
public class ServerObserver {
@SidedProxy(serverSide = Reference.PROXY_SERVER, clientSide = Reference.PROXY_CLIENT)
private static @Nullable IProxy proxy;

@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}

@EventHandler
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
if (proxy!=null)
proxy.preInit(event);
}

@EventHandler
public void init(final @Nonnull FMLInitializationEvent event) {
if (proxy!=null)
proxy.init(event);
}

@EventHandler
public void postInit(final @Nonnull FMLPostInitializationEvent event) {
if (proxy!=null)
proxy.postInit(event);
}
}
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
package net.teamfruit.serverobserver;

import java.io.File;
import java.io.IOException;

import javax.annotation.Nonnull;

import org.apache.commons.io.FileUtils;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class ClientProxy extends CommonProxy {
@Override
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
super.preInit(event);
final File cfgDir = event.getModConfigurationDirectory();
final File modCfgDir = new File(cfgDir, Reference.MODID);
final File oldCfg = event.getSuggestedConfigurationFile();
final File cfg = new File(modCfgDir, Reference.MODID+".cfg");
if (oldCfg.exists())
try {
FileUtils.moveFile(oldCfg, cfg);
} catch (final IOException e) {
}
final File dynCfg = new File(Minecraft.getMinecraft().mcDataDir, Reference.MODID+".cfg");
Config.init(cfg, dynCfg, "1.1.0", Compat.compat);
CoreHandler.instance.preInit(modCfgDir);
}

@Override
public void init(final @Nonnull FMLInitializationEvent event) {
super.init(event);
// Event Register
CoreHandler.instance.init();
}

@Override
public void postInit(final @Nonnull FMLPostInitializationEvent event) {
super.postInit(event);
Config.getConfig().save();
}
package net.teamfruit.serverobserver;

import java.io.File;
import java.io.IOException;

import javax.annotation.Nonnull;

import org.apache.commons.io.FileUtils;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class ClientProxy extends CommonProxy {
@Override
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
super.preInit(event);
final File cfgDir = event.getModConfigurationDirectory();
final File modCfgDir = new File(cfgDir, Reference.MODID);
final File oldCfg = event.getSuggestedConfigurationFile();
final File cfg = new File(modCfgDir, Reference.MODID+".cfg");
if (oldCfg.exists())
try {
FileUtils.moveFile(oldCfg, cfg);
} catch (final IOException e) {
}
final File dynCfg = new File(Minecraft.getMinecraft().mcDataDir, Reference.MODID+".cfg");
Config.init(cfg, dynCfg, "1.1.0", Compat.compat);
CoreHandler.instance.preInit(modCfgDir);
}

@Override
public void init(final @Nonnull FMLInitializationEvent event) {
super.init(event);
// Event Register
CoreHandler.instance.init();
}

@Override
public void postInit(final @Nonnull FMLPostInitializationEvent event) {
super.postInit(event);
Config.getConfig().save();
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package net.teamfruit.serverobserver;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class CommonProxy implements IProxy {
@Override
public void preInit(final FMLPreInitializationEvent event) {
}

@Override
public void init(final FMLInitializationEvent event) {
}

@Override
public void postInit(final FMLPostInitializationEvent event) {
}
}
package net.teamfruit.serverobserver;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class CommonProxy implements IProxy {
@Override
public void preInit(final FMLPreInitializationEvent event) {
}

@Override
public void init(final FMLInitializationEvent event) {
}

@Override
public void postInit(final FMLPostInitializationEvent event) {
}
}
Loading

0 comments on commit 798ae7f

Please sign in to comment.