-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
3,586 additions
and
3,622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
.../net/teamfruit/serverobserver/IProxy.java → .../net/teamfruit/serverobserver/IProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
88 changes: 44 additions & 44 deletions
88
...mfruit/serverobserver/ServerObserver.java → ...mfruit/serverobserver/ServerObserver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
88 changes: 44 additions & 44 deletions
88
...teamfruit/serverobserver/ClientProxy.java → ...teamfruit/serverobserver/ClientProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
38 changes: 19 additions & 19 deletions
38
...teamfruit/serverobserver/CommonProxy.java → ...teamfruit/serverobserver/CommonProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
} | ||
} |
Oops, something went wrong.