Spatial rework (#3048)

* Moved all spatial cells into a single dimension instead of one dimension per cell

Each cell will now be backed by a single region file each. So  backups and restores can still be done on a per cell level.

Old cells will not be migrated.

* Moved custom cell tracking to a capability based one on the world

The size and owner of a cell is now stored inside the capabilities of the world/dimension not a custom system and we can rely on forge handling the persistence of it.

* Added the cell id to the actual item tooltip, as this is now a real identifier and not an arbitrary dimension id.

* Added vanilla banners to the whitelist

* Added unittests to the dimension manager to ensure the algorithm mapping to the correct region file

* Updated the API to conform with the new dimenion/types/biomes registration and mappings

* Fixed a couple of bugs related to world/dimension/biome registration 

* Fixed a bug when transfering certain blocks due to passing missing/incorrect blockstate
This commit is contained in:
fscan
2017-08-24 11:24:33 +02:00
committed by yueh
parent 1513ba3f6a
commit bbf4d4a9ce
21 changed files with 615 additions and 427 deletions
@@ -28,6 +28,7 @@ import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.energy.IEnergyStorage;
import appeng.api.storage.ISpatialDimension;
import appeng.api.storage.IStorageMonitorableAccessor;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
@@ -45,6 +46,8 @@ public final class Capabilities
public static Capability<IStorageMonitorableAccessor> STORAGE_MONITORABLE_ACCESSOR;
public static Capability<ISpatialDimension> SPATIAL_DIMENSION;
public static Capability<ITeslaConsumer> TESLA_CONSUMER;
public static Capability<ITeslaHolder> TESLA_HOLDER;
@@ -57,6 +60,7 @@ public final class Capabilities
public static void register()
{
CapabilityManager.INSTANCE.register( IStorageMonitorableAccessor.class, createNullStorage(), NullMENetworkAccessor::new );
CapabilityManager.INSTANCE.register( ISpatialDimension.class, createNullStorage(), NullSpatialDimension::new );
}
@CapabilityInject( IStorageMonitorableAccessor.class )
@@ -65,6 +69,12 @@ public final class Capabilities
STORAGE_MONITORABLE_ACCESSOR = cap;
}
@CapabilityInject( ISpatialDimension.class )
private static void capISpatialDimensionRegistered( Capability<ISpatialDimension> cap )
{
SPATIAL_DIMENSION = cap;
}
@CapabilityInject( ITeslaConsumer.class )
private static void capITeslaConsumerRegistered( Capability<ITeslaConsumer> cap )
{