Merge pull request #1466 from thatsIch/e-instance-factory

Uses an instance factory access for AE2
This commit is contained in:
thatsIch
2015-05-18 19:26:46 +02:00
33 changed files with 148 additions and 149 deletions
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -66,7 +66,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setHardness( 0F ); this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) ); this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true );
} }
@Override @Override
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -60,10 +60,10 @@ import appeng.client.render.blocks.RendererCableBus;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.Api; import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
import appeng.parts.ICableBusContainer; import appeng.parts.ICableBusContainer;
@@ -394,9 +394,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{ {
out = ( (TileCableBus) te ).cb; out = ( (TileCableBus) te ).cb;
} }
else if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{ {
out = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getCableContainer( te ); out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
} }
return out == null ? NULL_CABLE_BUS : out; return out == null ? NULL_CABLE_BUS : out;
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -72,11 +72,11 @@ import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotPatternTerm; import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotRestrictedInput; import appeng.container.slot.SlotRestrictedInput;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketInventoryAction; import appeng.core.sync.packets.PacketInventoryAction;
import appeng.core.sync.packets.PacketSwapSlots; import appeng.core.sync.packets.PacketSwapSlots;
import appeng.helpers.InventoryAction; import appeng.helpers.InventoryAction;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.INEI; import appeng.integration.abstraction.INEI;
@@ -895,9 +895,9 @@ public abstract class AEBaseGui extends GuiContainer
private RenderItem setItemRender( RenderItem item ) private RenderItem setItemRender( RenderItem item )
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
{ {
return ( (INEI) AppEng.instance.getIntegration( IntegrationType.NEI ) ).setItemRender( item ); return ( (INEI) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.NEI ) ).setItemRender( item );
} }
else else
{ {
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -53,13 +53,13 @@ import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotFakeCraftingMatrix; import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis; import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig; import appeng.core.sync.packets.PacketValueConfig;
import appeng.helpers.WirelessTerminalGuiObject; import appeng.helpers.WirelessTerminalGuiObject;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.parts.reporting.PartTerminal; import appeng.parts.reporting.PartTerminal;
import appeng.tile.misc.TileSecurity; import appeng.tile.misc.TileSecurity;
@@ -221,7 +221,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.maxRows = this.getMaxRows(); this.maxRows = this.getMaxRows();
this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 ); this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
boolean hasNEI = AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ); boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI );
int NEI = hasNEI ? 0 : 0; int NEI = hasNEI ? 0 : 0;
int top = hasNEI ? 22 : 0; int top = hasNEI ? 22 : 0;
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -23,8 +23,8 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerSkyChest; import appeng.container.implementations.ContainerSkyChest;
import appeng.core.AppEng;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.tile.storage.TileSkyChest; import appeng.tile.storage.TileSkyChest;
@@ -55,6 +55,6 @@ public class GuiSkyChest extends AEBaseGui
@Override @Override
protected boolean enableSpaceClicking() protected boolean enableSpaceClicking()
{ {
return !AppEng.instance.isIntegrationEnabled( IntegrationType.InvTweaks ); return !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks );
} }
} }
+20 -23
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,7 @@ package appeng.core;
import java.io.File; import java.io.File;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
@@ -45,7 +46,6 @@ import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.hooks.TickHandler; import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.server.AECommand; import appeng.server.AECommand;
import appeng.services.VersionChecker; import appeng.services.VersionChecker;
import appeng.services.version.VersionCheckerConfig; import appeng.services.version.VersionCheckerConfig;
@@ -68,38 +68,35 @@ public final class AppEng
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion + net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion + net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion
public static AppEng instance;
@Nonnull
private static final AppEng INSTANCE = new AppEng();
private final IMCHandler imcHandler; private final IMCHandler imcHandler;
private File configDirectory; private File configDirectory;
public AppEng() AppEng()
{ {
instance = this;
this.imcHandler = new IMCHandler(); this.imcHandler = new IMCHandler();
FMLCommonHandler.instance().registerCrashCallable( new ModCrashEnhancement( CrashInfo.MOD_VERSION ) ); FMLCommonHandler.instance().registerCrashCallable( new ModCrashEnhancement( CrashInfo.MOD_VERSION ) );
} }
@Nonnull
@Mod.InstanceFactory
public static AppEng instance()
{
return INSTANCE;
}
public final File getConfigDirectory() public final File getConfigDirectory()
{ {
return this.configDirectory; return this.configDirectory;
} }
public boolean isIntegrationEnabled( IntegrationType integrationName )
{
return IntegrationRegistry.INSTANCE.isEnabled( integrationName );
}
public Object getIntegration( IntegrationType integrationName )
{
return IntegrationRegistry.INSTANCE.getInstance( integrationName );
}
@EventHandler @EventHandler
void preInit( FMLPreInitializationEvent event ) private void preInit( FMLPreInitializationEvent event )
{ {
if( !Loader.isModLoaded( "appliedenergistics2-core" ) ) if( !Loader.isModLoaded( "appliedenergistics2-core" ) )
{ {
@@ -153,7 +150,7 @@ public final class AppEng
} }
@EventHandler @EventHandler
void init( FMLInitializationEvent event ) private void init( FMLInitializationEvent event )
{ {
Stopwatch star = Stopwatch.createStarted(); Stopwatch star = Stopwatch.createStarted();
AELog.info( "Initialization ( started )" ); AELog.info( "Initialization ( started )" );
@@ -165,7 +162,7 @@ public final class AppEng
} }
@EventHandler @EventHandler
void postInit( FMLPostInitializationEvent event ) private void postInit( FMLPostInitializationEvent event )
{ {
Stopwatch star = Stopwatch.createStarted(); Stopwatch star = Stopwatch.createStarted();
AELog.info( "Post Initialization ( started )" ); AELog.info( "Post Initialization ( started )" );
@@ -184,26 +181,26 @@ public final class AppEng
} }
@EventHandler @EventHandler
public void handleIMCEvent( FMLInterModComms.IMCEvent event ) private void handleIMCEvent( FMLInterModComms.IMCEvent event )
{ {
this.imcHandler.handleIMCEvent( event ); this.imcHandler.handleIMCEvent( event );
} }
@EventHandler @EventHandler
public void serverStopping( FMLServerStoppingEvent event ) private void serverStopping( FMLServerStoppingEvent event )
{ {
WorldSettings.getInstance().shutdown(); WorldSettings.getInstance().shutdown();
TickHandler.INSTANCE.shutdown(); TickHandler.INSTANCE.shutdown();
} }
@EventHandler @EventHandler
public void serverAboutToStart( FMLServerAboutToStartEvent evt ) private void serverAboutToStart( FMLServerAboutToStartEvent evt )
{ {
WorldSettings.getInstance().init(); WorldSettings.getInstance().init();
} }
@EventHandler @EventHandler
public void serverStarting( FMLServerStartingEvent evt ) private void serverStarting( FMLServerStartingEvent evt )
{ {
evt.registerServerCommand( new AECommand( evt.getServer() ) ); evt.registerServerCommand( new AECommand( evt.getServer() ) );
} }
+4 -2
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -38,6 +38,8 @@ import appeng.core.api.imc.IMCSpatial;
*/ */
public class IMCHandler public class IMCHandler
{ {
private static final int INITIAL_PROCESSORS_CAPACITY = 20;
/** /**
* Contains the processors, * Contains the processors,
* *
@@ -51,7 +53,7 @@ public class IMCHandler
*/ */
public IMCHandler() public IMCHandler()
{ {
this.processors = new HashMap<String, IIMCProcessor>(); this.processors = new HashMap<String, IIMCProcessor>( INITIAL_PROCESSORS_CAPACITY );
this.processors.put( "blacklist-block-spatial", new IMCBlackListSpatial() ); this.processors.put( "blacklist-block-spatial", new IMCBlackListSpatial() );
this.processors.put( "whitelist-spatial", new IMCSpatial() ); this.processors.put( "whitelist-spatial", new IMCSpatial() );
+6 -5
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -76,6 +76,7 @@ import appeng.core.localization.PlayerMessages;
import appeng.core.stats.PlayerStatsRegistration; import appeng.core.stats.PlayerStatsRegistration;
import appeng.hooks.AETrading; import appeng.hooks.AETrading;
import appeng.hooks.TickHandler; import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.items.materials.ItemMultiMaterial; import appeng.items.materials.ItemMultiMaterial;
import appeng.me.cache.CraftingGridCache; import appeng.me.cache.CraftingGridCache;
@@ -517,7 +518,7 @@ public final class Registration
if( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) ) if( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) )
{ {
this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigDirectory() ), "index.recipe" ); this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance().getConfigDirectory() ), "index.recipe" );
} }
else else
{ {
@@ -528,18 +529,18 @@ public final class Registration
partHelper.registerNewLayer( "appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable" );
if( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{ {
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
} }
if( AppEng.instance.isIntegrationEnabled( IntegrationType.RF ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RF ) )
{ {
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
} }
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.OpenComputers ) ) if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{ {
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
} }
+4 -4
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -52,8 +52,8 @@ import appeng.api.parts.IPartItem;
import appeng.api.parts.LayerBase; import appeng.api.parts.LayerBase;
import appeng.client.render.BusRenderer; import appeng.client.render.BusRenderer;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
import appeng.parts.PartPlacement; import appeng.parts.PartPlacement;
@@ -73,9 +73,9 @@ public class ApiPart implements IPartHelper
{ {
for( Class layerInterface : this.interfaces2Layer.keySet() ) for( Class layerInterface : this.interfaces2Layer.keySet() )
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{ {
( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).registerPassThrough( layerInterface ); ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).registerPassThrough( layerInterface );
} }
} }
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -26,9 +26,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import appeng.core.AppEng;
import appeng.core.sync.AppEngPacket; import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo; import appeng.core.sync.network.INetworkInfo;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
@@ -54,7 +54,7 @@ public class PacketMultiPart extends AppEngPacket
@Override @Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
{ {
IFMP fmp = (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ); IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP );
if( fmp != null ) if( fmp != null )
{ {
EntityPlayerMP sender = (EntityPlayerMP) player; EntityPlayerMP sender = (EntityPlayerMP) player;
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -41,7 +41,7 @@ public class BlockChunkloader extends AEBaseBlock implements LoadingCallback
{ {
super( Material.iron ); super( Material.iron );
this.setTileEntity( TileChunkLoader.class ); this.setTileEntity( TileChunkLoader.class );
ForgeChunkManager.setForcedChunkLoadingCallback( AppEng.instance, this ); ForgeChunkManager.setForcedChunkLoadingCallback( AppEng.instance(), this );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
} }
@@ -62,7 +62,7 @@ public class TileChunkLoader extends AEBaseTile
return; return;
} }
this.ct = ForgeChunkManager.requestTicket( AppEng.instance, this.worldObj, Type.NORMAL ); this.ct = ForgeChunkManager.requestTicket( AppEng.instance(), this.worldObj, Type.NORMAL );
if( this.ct == null ) if( this.ct == null )
{ {
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -33,7 +33,7 @@ import appeng.api.AEApi;
import appeng.api.parts.IFacadeContainer; import appeng.api.parts.IFacadeContainer;
import appeng.api.parts.IFacadePart; import appeng.api.parts.IFacadePart;
import appeng.api.parts.IPartHost; import appeng.api.parts.IPartHost;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.items.parts.ItemFacade; import appeng.items.parts.ItemFacade;
@@ -137,9 +137,9 @@ public class FacadeContainer implements IFacadeContainer
boolean isBC = ids[0] < 0; boolean isBC = ids[0] < 0;
ids[0] = Math.abs( ids[0] ); ids[0] = Math.abs( ids[0] );
if( isBC && AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
{ {
IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
changed = changed || this.storage.getFacade( x ) == null; changed = changed || this.storage.getFacade( x ) == null;
this.storage.setFacade( x, bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side ) ); this.storage.setFacade( x, bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side ) );
} }
@@ -187,9 +187,9 @@ public class FacadeContainer implements IFacadeContainer
} }
else else
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
{ {
IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
if( bc.isFacade( is ) ) if( bc.isFacade( is ) )
{ {
this.storage.setFacade( x, bc.createFacadePart( is, ForgeDirection.getOrientation( x ) ) ); this.storage.setFacade( x, bc.createFacadePart( is, ForgeDirection.getOrientation( x ) ) );
+5 -5
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -51,7 +51,7 @@ import appeng.api.parts.ISimplifiedBundle;
import appeng.client.render.BusRenderHelper; import appeng.client.render.BusRenderHelper;
import appeng.client.render.RenderBlocksWorkaround; import appeng.client.render.RenderBlocksWorkaround;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.util.Platform; import appeng.util.Platform;
@@ -133,7 +133,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
IIcon myIcon = null; IIcon myIcon = null;
if( this.isBC() ) if( this.isBC() )
{ {
IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
myIcon = bc.getFacadeTexture(); myIcon = bc.getFacadeTexture();
} }
@@ -353,9 +353,9 @@ public class FacadePart implements IFacadePart, IBoxProvider
return facade.getTextureItem( this.facade ); return facade.getTextureItem( this.facade );
} }
else if( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
{ {
IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
return bc.getTextureForFacade( this.facade ); return bc.getTextureForFacade( this.facade );
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -114,7 +114,7 @@ public enum MaterialType
this.damageValue = metaValue; this.damageValue = metaValue;
this.droppedEntity = c; this.droppedEntity = c;
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
} }
MaterialType( int metaValue, AEFeature part, String oreDictionary, Class<? extends Entity> c ) MaterialType( int metaValue, AEFeature part, String oreDictionary, Class<? extends Entity> c )
@@ -123,7 +123,7 @@ public enum MaterialType
this.damageValue = metaValue; this.damageValue = metaValue;
this.oreName = oreDictionary; this.oreName = oreDictionary;
this.droppedEntity = c; this.droppedEntity = c;
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
} }
MaterialType( int metaValue, AEFeature part, String oreDictionary ) MaterialType( int metaValue, AEFeature part, String oreDictionary )
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -21,7 +21,6 @@ package appeng.items.misc;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@@ -73,7 +72,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
this.setHasSubtypes( true ); this.setHasSubtypes( true );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
} }
@Nullable @Nullable
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -63,9 +63,9 @@ import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord; import appeng.api.util.DimensionalCoord;
import appeng.client.render.CableRenderHelper; import appeng.client.render.CableRenderHelper;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.facade.FacadeContainer; import appeng.facade.FacadeContainer;
import appeng.helpers.AEMultiTile; import appeng.helpers.AEMultiTile;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.ICLApi; import appeng.integration.abstraction.ICLApi;
import appeng.me.GridConnection; import appeng.me.GridConnection;
@@ -885,9 +885,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
} }
} }
if( light > 0 && AppEng.instance.isIntegrationEnabled( IntegrationType.CLApi ) ) if( light > 0 && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.CLApi ) )
{ {
return ( (ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi ) ).colorLight( this.getColor(), light ); return ( (ICLApi) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.CLApi ) ).colorLight( this.getColor(), light );
} }
return light; return light;
+14 -14
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -52,12 +52,12 @@ import appeng.api.parts.IPartItem;
import appeng.api.parts.PartItemStack; import appeng.api.parts.PartItemStack;
import appeng.api.parts.SelectedPart; import appeng.api.parts.SelectedPart;
import appeng.api.util.DimensionalCoord; import appeng.api.util.DimensionalCoord;
import appeng.core.AppEng;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketClick; import appeng.core.sync.packets.PacketClick;
import appeng.core.sync.packets.PacketPartPlacement; import appeng.core.sync.packets.PacketPartPlacement;
import appeng.facade.IFacadeItem; import appeng.facade.IFacadeItem;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
@@ -196,14 +196,14 @@ public class PartPlacement
} }
} }
if( host == null && tile != null && AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{ {
host = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getOrCreateHost( tile ); host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
} }
if( host == null && tile != null && AppEng.instance.isIntegrationEnabled( IntegrationType.ImmibisMicroblocks ) ) if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
{ {
host = ( (IImmibisMicroblocks) AppEng.instance.getIntegration( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, face, tile ); host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, face, tile );
} }
// if ( held == null ) // if ( held == null )
@@ -266,14 +266,14 @@ public class PartPlacement
host = (IPartHost) tile; host = (IPartHost) tile;
} }
if( host == null && tile != null && AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{ {
host = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getOrCreateHost( tile ); host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
} }
if( host == null && tile != null && AppEng.instance.isIntegrationEnabled( IntegrationType.ImmibisMicroblocks ) ) if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
{ {
host = ( (IImmibisMicroblocks) AppEng.instance.getIntegration( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, face, tile ); host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, face, tile );
} }
final Optional<ItemStack> maybeMultiPartStack = multiPart.maybeStack( 1 ); final Optional<ItemStack> maybeMultiPartStack = multiPart.maybeStack( 1 );
@@ -326,9 +326,9 @@ public class PartPlacement
Block blkID = world.getBlock( te_x, te_y, te_z ); Block blkID = world.getBlock( te_x, te_y, te_z );
tile = world.getTileEntity( te_x, te_y, te_z ); tile = world.getTileEntity( te_x, te_y, te_z );
if( tile != null && AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) if( tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{ {
host = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getOrCreateHost( tile ); host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
} }
if( ( blkID == null || blkID.isReplaceable( world, te_x, te_y, te_z ) || host != null ) && side != ForgeDirection.UNKNOWN ) if( ( blkID == null || blkID.isReplaceable( world, te_x, te_y, te_z ) || host != null ) && side != ForgeDirection.UNKNOWN )
@@ -418,9 +418,9 @@ public class PartPlacement
return ( (IFacadeItem) held.getItem() ).createPartFromItemStack( held, side ); return ( (IFacadeItem) held.getItem() ).createPartFromItemStack( held, side );
} }
if( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
{ {
IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
if( bc.isFacade( held ) ) if( bc.isFacade( held ) )
{ {
return bc.createFacadePart( held, side ); return bc.createFacadePart( held, side );
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -46,8 +46,8 @@ import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.ticking.IGridTickable; import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation; import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest; import appeng.api.networking.ticking.TickingRequest;
import appeng.core.AppEng;
import appeng.core.settings.TickRates; import appeng.core.settings.TickRates;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.me.GridAccessException; import appeng.me.GridAccessException;
@@ -141,9 +141,9 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
this.which.add( this ); this.which.add( this );
if( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
{ {
IBC buildcraft = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); IBC buildcraft = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
if( buildcraft != null ) if( buildcraft != null )
{ {
if( buildcraft.isPipe( te, this.side.getOpposite() ) ) if( buildcraft.isPipe( te, this.side.getOpposite() ) )
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -20,7 +20,6 @@ package appeng.parts.p2p;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -45,9 +44,9 @@ import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation; import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest; import appeng.api.networking.ticking.TickingRequest;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.settings.TickRates; import appeng.core.settings.TickRates;
import appeng.hooks.TickHandler; import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.me.GridAccessException; import appeng.me.GridAccessException;
import appeng.transformer.annotations.Integration.Interface; import appeng.transformer.annotations.Integration.Interface;
@@ -66,7 +65,7 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
{ {
super( is ); super( is );
if ( !AppEng.instance.isIntegrationEnabled( IntegrationType.OpenComputers ) ) if ( !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{ {
throw new RuntimeException( "OpenComputers is not installed!" ); throw new RuntimeException( "OpenComputers is not installed!" );
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IRC; import appeng.integration.abstraction.IRC;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
@@ -61,9 +61,9 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
@Override @Override
public void register() throws RegistrationError, MissingIngredientError public void register() throws RegistrationError, MissingIngredientError
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.RC ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RC ) )
{ {
IRC rc = (IRC) AppEng.instance.getIntegration( IntegrationType.RC ); IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC );
for( ItemStack is : this.pro_input.getItemStackSet() ) for( ItemStack is : this.pro_input.getItemStackSet() )
{ {
try try
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFZ; import appeng.integration.abstraction.IFZ;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
@@ -61,9 +61,9 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
@Override @Override
public void register() throws RegistrationError, MissingIngredientError public void register() throws RegistrationError, MissingIngredientError
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.FZ ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FZ ) )
{ {
IFZ fz = (IFZ) AppEng.instance.getIntegration( IntegrationType.FZ ); IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ );
for( ItemStack is : this.pro_input.getItemStackSet() ) for( ItemStack is : this.pro_input.getItemStackSet() )
{ {
try try
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IIC2; import appeng.integration.abstraction.IIC2;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
@@ -61,9 +61,9 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
@Override @Override
public void register() throws RegistrationError, MissingIngredientError public void register() throws RegistrationError, MissingIngredientError
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{ {
IIC2 ic2 = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 );
for( ItemStack is : this.pro_input.getItemStackSet() ) for( ItemStack is : this.pro_input.getItemStackSet() )
{ {
try try
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IMekanism; import appeng.integration.abstraction.IMekanism;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
@@ -62,9 +62,9 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
@Override @Override
public void register() throws RegistrationError, MissingIngredientError public void register() throws RegistrationError, MissingIngredientError
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) )
{ {
IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism ); IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( ItemStack is : this.pro_input.getItemStackSet() ) for( ItemStack is : this.pro_input.getItemStackSet() )
{ {
try try
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IMekanism; import appeng.integration.abstraction.IMekanism;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
@@ -61,9 +61,9 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
@Override @Override
public void register() throws RegistrationError, MissingIngredientError public void register() throws RegistrationError, MissingIngredientError
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) )
{ {
IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism ); IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( ItemStack is : this.pro_input.getItemStackSet() ) for( ItemStack is : this.pro_input.getItemStackSet() )
{ {
try try
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -173,7 +173,7 @@ public final class VersionChecker implements Runnable
} }
versionInf.setString( "newFileName", "appliedenergistics2-" + ghFormatted + ".jar" ); versionInf.setString( "newFileName", "appliedenergistics2-" + ghFormatted + ".jar" );
FMLInterModComms.sendRuntimeMessage( AppEng.instance, "VersionChecker", "addUpdate", versionInf ); FMLInterModComms.sendRuntimeMessage( AppEng.instance(), "VersionChecker", "addUpdate", versionInf );
AELog.info( "Reported new version to VersionChecker mod." ); AELog.info( "Reported new version to VersionChecker mod." );
} }
@@ -43,10 +43,10 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord; import appeng.api.util.DimensionalCoord;
import appeng.block.networking.BlockCableBus; import appeng.block.networking.BlockCableBus;
import appeng.core.AppEng;
import appeng.helpers.AEMultiTile; import appeng.helpers.AEMultiTile;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
import appeng.hooks.TickHandler; import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IImmibisMicroblocks; import appeng.integration.abstraction.IImmibisMicroblocks;
import appeng.parts.CableBusContainer; import appeng.parts.CableBusContainer;
@@ -324,9 +324,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
@Override @Override
public void cleanup() public void cleanup()
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.ImmibisMicroblocks ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
{ {
IImmibisMicroblocks imb = (IImmibisMicroblocks) AppEng.instance.getIntegration( IntegrationType.ImmibisMicroblocks ); IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks );
if( imb != null && imb.leaveParts( this ) ) if( imb != null && imb.leaveParts( this ) )
{ {
return; return;
+6 -6
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -27,7 +27,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySink;
import appeng.api.config.PowerUnits; import appeng.api.config.PowerUnits;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IIC2; import appeng.integration.abstraction.IIC2;
import appeng.transformer.annotations.Integration.Interface; import appeng.transformer.annotations.Integration.Interface;
@@ -77,9 +77,9 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink
private void removeFromENet() private void removeFromENet()
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{ {
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 );
if( this.isInIC2 && Platform.isServer() && ic2Integration != null ) if( this.isInIC2 && Platform.isServer() && ic2Integration != null )
{ {
ic2Integration.removeFromEnergyNet( this ); ic2Integration.removeFromEnergyNet( this );
@@ -104,9 +104,9 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink
private void addToENet() private void addToENet()
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{ {
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 );
if( !this.isInIC2 && Platform.isServer() && ic2Integration != null ) if( !this.isInIC2 && Platform.isServer() && ic2Integration != null )
{ {
ic2Integration.addToEnergyNet( this ); ic2Integration.addToEnergyNet( this );
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,7 @@ import net.minecraft.tileentity.TileEntityChest;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBetterStorage; import appeng.integration.abstraction.IBetterStorage;
import appeng.util.inv.AdaptorIInventory; import appeng.util.inv.AdaptorIInventory;
@@ -51,7 +51,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
return null; return null;
} }
IBetterStorage bs = (IBetterStorage) ( AppEng.instance.isIntegrationEnabled( IntegrationType.BetterStorage ) ? AppEng.instance.getIntegration( IntegrationType.BetterStorage ) : null ); IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null );
if( te instanceof EntityPlayer ) if( te instanceof EntityPlayer )
{ {
+4 -4
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -23,7 +23,7 @@ import java.util.Comparator;
import appeng.api.config.SortDir; import appeng.api.config.SortDir;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IInvTweaks; import appeng.integration.abstraction.IInvTweaks;
import appeng.util.item.AEItemStack; import appeng.util.item.AEItemStack;
@@ -114,9 +114,9 @@ public class ItemSorters
return; return;
} }
if( AppEng.instance.isIntegrationEnabled( IntegrationType.InvTweaks ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks ) )
{ {
api = (IInvTweaks) AppEng.instance.getIntegration( IntegrationType.InvTweaks ); api = (IInvTweaks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.InvTweaks );
} }
else else
{ {
+7 -6
View File
@@ -126,6 +126,7 @@ import appeng.core.stats.Stats;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.core.sync.GuiHostType; import appeng.core.sync.GuiHostType;
import appeng.hooks.TickHandler; import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.me.GridAccessException; import appeng.me.GridAccessException;
import appeng.me.GridNode; import appeng.me.GridNode;
@@ -320,17 +321,17 @@ public class Platform
private static boolean isNotValidSetting( Enum e ) private static boolean isNotValidSetting( Enum e )
{ {
if( e == SortOrder.INVTWEAKS && !AppEng.instance.isIntegrationEnabled( IntegrationType.InvTweaks ) ) if( e == SortOrder.INVTWEAKS && !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks ) )
{ {
return true; return true;
} }
if( e == SearchBoxMode.NEI_AUTOSEARCH && !AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) ) if( e == SearchBoxMode.NEI_AUTOSEARCH && !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
{ {
return true; return true;
} }
if( e == SearchBoxMode.NEI_MANUAL_SEARCH && !AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) ) if( e == SearchBoxMode.NEI_MANUAL_SEARCH && !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
{ {
return true; return true;
} }
@@ -359,15 +360,15 @@ public class Platform
{ {
if( tile == null && type.getType() == GuiHostType.ITEM ) if( tile == null && type.getType() == GuiHostType.ITEM )
{ {
p.openGui( AppEng.instance, type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0 ); p.openGui( AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0 );
} }
else if( tile == null || type.getType() == GuiHostType.ITEM ) else if( tile == null || type.getType() == GuiHostType.ITEM )
{ {
p.openGui( AppEng.instance, type.ordinal() << 4 | ( 1 << 3 ), p.getEntityWorld(), x, y, z ); p.openGui( AppEng.instance(), type.ordinal() << 4 | ( 1 << 3 ), p.getEntityWorld(), x, y, z );
} }
else else
{ {
p.openGui( AppEng.instance, type.ordinal() << 4 | ( side.ordinal() ), tile.getWorldObj(), x, y, z ); p.openGui( AppEng.instance(), type.ordinal() << 4 | ( side.ordinal() ), tile.getWorldObj(), x, y, z );
} }
} }
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.util.InventoryAdaptor; import appeng.util.InventoryAdaptor;
@@ -42,7 +42,7 @@ public class AdaptorBCPipe extends InventoryAdaptor
public AdaptorBCPipe( TileEntity s, ForgeDirection dd ) public AdaptorBCPipe( TileEntity s, ForgeDirection dd )
{ {
this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
if( this.bc != null ) if( this.bc != null )
{ {
if( this.bc.isPipe( s, dd ) ) if( this.bc.isPipe( s, dd ) )
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@@ -25,7 +25,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.core.AppEng; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
@@ -39,7 +39,7 @@ public class WrapperBCPipe implements IInventory
public WrapperBCPipe( TileEntity te, ForgeDirection d ) public WrapperBCPipe( TileEntity te, ForgeDirection d )
{ {
this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
this.ad = te; this.ad = te;
this.dir = d; this.dir = d;
} }