Moved proxy classes to separate package

This commit is contained in:
Emmanuel BENOîT 2016-06-15 13:46:06 +02:00
parent 96c361bc03
commit 04b59c76e0
4 changed files with 63 additions and 44 deletions

View file

@ -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 );

View 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( );
}
}

View 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( ) );
}
}

View file

@ -0,0 +1,7 @@
package mmm.proxy;
public class PServer
extends PCommon
{
// EMPTY
}