Third update pass (3/?)
Last (?) update pass. AE2 can be launched and used (?) in game. Rendering system changed again and again - rendering is NOT working, to be rewritten and CAN be done a lot simpler.
This commit is contained in:
@@ -58,7 +58,7 @@ public final class ApiDefinitions implements IDefinitions
|
||||
return this.handlers;
|
||||
}
|
||||
|
||||
FeatureRegistry getFeatureRegistry()
|
||||
public FeatureRegistry getFeatureRegistry()
|
||||
{
|
||||
return this.features;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public final class AppEng
|
||||
@EventHandler
|
||||
private void serverAboutToStart( final FMLServerAboutToStartEvent evt )
|
||||
{
|
||||
WorldData.onServerAboutToStart();
|
||||
WorldData.onServerAboutToStart( evt.getServer() );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class FeatureRegistry
|
||||
this.registry.add( feature );
|
||||
}
|
||||
|
||||
Set<IAEFeature> getRegisteredFeatures()
|
||||
public Set<IAEFeature> getRegisteredFeatures()
|
||||
{
|
||||
return this.registry;
|
||||
}
|
||||
|
||||
@@ -23,12 +23,13 @@ import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
@@ -69,18 +70,19 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
if( this.enabled )
|
||||
{
|
||||
final String name = this.extractor.get();
|
||||
this.featured.setRegistryName( AppEng.MOD_ID, name );
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, name );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), name );
|
||||
GameRegistry.register( this.featured );
|
||||
|
||||
// register the block/item conversion...
|
||||
if( this.definition.maybeItem().isPresent() )
|
||||
{
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
final Item featuredItem = this.definition.maybeItem().get();
|
||||
featuredItem.setRegistryName( AppEng.MOD_ID, name );
|
||||
GameRegistry.register( featuredItem );
|
||||
}
|
||||
|
||||
if( side == Side.CLIENT )
|
||||
|
||||
@@ -54,6 +54,7 @@ import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
@@ -220,6 +221,8 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
AEBaseGui.class.getName();
|
||||
|
||||
final String start = this.containerClass.getName();
|
||||
final String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import javax.annotation.Nullable;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
@@ -121,10 +122,15 @@ public final class WorldData implements IWorldData
|
||||
* Requires to start up from external from here
|
||||
*
|
||||
* drawback of the singleton build style
|
||||
* @param server
|
||||
*/
|
||||
public static void onServerAboutToStart()
|
||||
public static void onServerAboutToStart( MinecraftServer server )
|
||||
{
|
||||
final File worldDirectory = DimensionManager.getCurrentSaveRootDirectory();
|
||||
File worldDirectory = DimensionManager.getCurrentSaveRootDirectory();
|
||||
if( worldDirectory == null )
|
||||
{
|
||||
worldDirectory = server.getActiveAnvilConverter().getSaveLoader( server.getFolderName(), false ).getWorldDirectory();
|
||||
}
|
||||
final WorldData newInstance = new WorldData( worldDirectory );
|
||||
|
||||
instance = newInstance;
|
||||
|
||||
Reference in New Issue
Block a user