Moved proxy classes to separate package
This commit is contained in:
parent
96c361bc03
commit
04b59c76e0
4 changed files with 63 additions and 44 deletions
|
@ -1,12 +1,8 @@
|
||||||
package mmm;
|
package mmm;
|
||||||
|
|
||||||
|
|
||||||
import mmm.deco.DecorativeBlocks;
|
import mmm.proxy.PCommon;
|
||||||
import mmm.utils.UAccessors;
|
|
||||||
import mmm.utils.URegistry;
|
|
||||||
import mmm.utils.USeat;
|
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
|
||||||
import net.minecraftforge.fml.common.SidedProxy;
|
import net.minecraftforge.fml.common.SidedProxy;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
@ -23,57 +19,26 @@ public class Mmm
|
||||||
public static final String PREFIX = Mmm.ID + ".";
|
public static final String PREFIX = Mmm.ID + ".";
|
||||||
|
|
||||||
@Mod.Instance( Mmm.ID )
|
@Mod.Instance( Mmm.ID )
|
||||||
public static Mmm mmm;
|
private static Mmm instance;
|
||||||
|
|
||||||
@SidedProxy
|
@SidedProxy( clientSide = "mmm.proxy.PClient" , serverSide = "mmm.proxy.PServer" )
|
||||||
public static CommonProxy proxy = null;
|
private static PCommon proxy = null;
|
||||||
|
|
||||||
public static abstract class CommonProxy
|
|
||||||
|
public static Mmm get( )
|
||||||
{
|
{
|
||||||
|
return Mmm.instance;
|
||||||
public void preInit( final FMLPreInitializationEvent event )
|
|
||||||
{
|
|
||||||
UAccessors.preInit( );
|
|
||||||
|
|
||||||
DecorativeBlocks.preInit( );
|
|
||||||
URegistry.registerRecipes( );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void init( final FMLInitializationEvent event )
|
|
||||||
{
|
|
||||||
USeat.register( mmm );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ServerProxy
|
|
||||||
extends CommonProxy
|
|
||||||
{
|
|
||||||
// EMPTY
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ClientProxy
|
|
||||||
extends CommonProxy
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void preInit( final FMLPreInitializationEvent event )
|
|
||||||
{
|
|
||||||
super.preInit( event );
|
|
||||||
URegistry.setupItemModels( );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@Mod.EventHandler
|
||||||
public void preInit( final FMLPreInitializationEvent event )
|
public void preInit( final FMLPreInitializationEvent event )
|
||||||
{
|
{
|
||||||
Mmm.proxy.preInit( event );
|
Mmm.proxy.preInit( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@Mod.EventHandler
|
||||||
public void init( final FMLInitializationEvent event )
|
public void init( final FMLInitializationEvent event )
|
||||||
{
|
{
|
||||||
Mmm.proxy.init( event );
|
Mmm.proxy.init( event );
|
||||||
|
|
17
src/java/mmm/proxy/PClient.java
Normal file
17
src/java/mmm/proxy/PClient.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package mmm.proxy;
|
||||||
|
|
||||||
|
import mmm.utils.URegistry;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
|
public class PClient
|
||||||
|
extends PCommon
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preInit( final FMLPreInitializationEvent event )
|
||||||
|
{
|
||||||
|
super.preInit( event );
|
||||||
|
URegistry.setupItemModels( );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
30
src/java/mmm/proxy/PCommon.java
Normal file
30
src/java/mmm/proxy/PCommon.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
package mmm.proxy;
|
||||||
|
|
||||||
|
|
||||||
|
import mmm.Mmm;
|
||||||
|
import mmm.deco.DecorativeBlocks;
|
||||||
|
import mmm.utils.UAccessors;
|
||||||
|
import mmm.utils.URegistry;
|
||||||
|
import mmm.utils.USeat;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class PCommon
|
||||||
|
{
|
||||||
|
|
||||||
|
public void preInit( final FMLPreInitializationEvent event )
|
||||||
|
{
|
||||||
|
UAccessors.preInit( );
|
||||||
|
|
||||||
|
DecorativeBlocks.preInit( );
|
||||||
|
URegistry.registerRecipes( );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init( final FMLInitializationEvent event )
|
||||||
|
{
|
||||||
|
USeat.register( Mmm.get( ) );
|
||||||
|
}
|
||||||
|
}
|
7
src/java/mmm/proxy/PServer.java
Normal file
7
src/java/mmm/proxy/PServer.java
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package mmm.proxy;
|
||||||
|
|
||||||
|
public class PServer
|
||||||
|
extends PCommon
|
||||||
|
{
|
||||||
|
// EMPTY
|
||||||
|
}
|
Reference in a new issue