reformatted all src files (#141)
This commit is contained in:
@@ -22,20 +22,18 @@ package appeng.spatial;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
|
||||
public class BiomeGenStorage extends Biome
|
||||
{
|
||||
public class BiomeGenStorage extends Biome {
|
||||
|
||||
public BiomeGenStorage()
|
||||
{
|
||||
super( new BiomeProperties( "Storage Cell" ).setBaseBiome( "void" ).setRainDisabled().setTemperature( -100 ) );
|
||||
public BiomeGenStorage() {
|
||||
super(new BiomeProperties("Storage Cell").setBaseBiome("void").setRainDisabled().setTemperature(-100));
|
||||
|
||||
this.decorator.treesPerChunk = 0;
|
||||
this.decorator.flowersPerChunk = 0;
|
||||
this.decorator.grassPerChunk = 0;
|
||||
this.decorator.treesPerChunk = 0;
|
||||
this.decorator.flowersPerChunk = 0;
|
||||
this.decorator.grassPerChunk = 0;
|
||||
|
||||
this.spawnableMonsterList.clear();
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCaveCreatureList.clear();
|
||||
}
|
||||
this.spawnableMonsterList.clear();
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCaveCreatureList.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,14 @@
|
||||
package appeng.spatial;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
import appeng.api.movable.IMovableRegistry;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -34,435 +37,357 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
import appeng.api.movable.IMovableRegistry;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.util.Platform;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
||||
public class CachedPlane
|
||||
{
|
||||
private final int x_size;
|
||||
private final int z_size;
|
||||
private final int cx_size;
|
||||
private final int cz_size;
|
||||
private final int x_offset;
|
||||
private final int y_offset;
|
||||
private final int z_offset;
|
||||
private final int y_size;
|
||||
private final Chunk[][] myChunks;
|
||||
private final Column[][] myColumns;
|
||||
private final List<TileEntity> tiles = new ArrayList<>();
|
||||
private final List<NextTickListEntry> ticks = new ArrayList<>();
|
||||
private final World world;
|
||||
private final IMovableRegistry reg = AEApi.instance().registries().movable();
|
||||
private final List<WorldCoord> updates = new ArrayList<>();
|
||||
private int verticalBits;
|
||||
private final IBlockState matrixBlockState;
|
||||
public class CachedPlane {
|
||||
private final int x_size;
|
||||
private final int z_size;
|
||||
private final int cx_size;
|
||||
private final int cz_size;
|
||||
private final int x_offset;
|
||||
private final int y_offset;
|
||||
private final int z_offset;
|
||||
private final int y_size;
|
||||
private final Chunk[][] myChunks;
|
||||
private final Column[][] myColumns;
|
||||
private final List<TileEntity> tiles = new ArrayList<>();
|
||||
private final List<NextTickListEntry> ticks = new ArrayList<>();
|
||||
private final World world;
|
||||
private final IMovableRegistry reg = AEApi.instance().registries().movable();
|
||||
private final List<WorldCoord> updates = new ArrayList<>();
|
||||
private int verticalBits;
|
||||
private final IBlockState matrixBlockState;
|
||||
|
||||
public CachedPlane( final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ )
|
||||
{
|
||||
public CachedPlane(final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) {
|
||||
|
||||
Block matrixFrameBlock = AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().orElse( null );
|
||||
if( matrixFrameBlock != null )
|
||||
{
|
||||
this.matrixBlockState = matrixFrameBlock.getDefaultState();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.matrixBlockState = null;
|
||||
}
|
||||
Block matrixFrameBlock = AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().orElse(null);
|
||||
if (matrixFrameBlock != null) {
|
||||
this.matrixBlockState = matrixFrameBlock.getDefaultState();
|
||||
} else {
|
||||
this.matrixBlockState = null;
|
||||
}
|
||||
|
||||
this.world = w;
|
||||
this.world = w;
|
||||
|
||||
this.x_size = maxX - minX + 1;
|
||||
this.y_size = maxY - minY + 1;
|
||||
this.z_size = maxZ - minZ + 1;
|
||||
this.x_size = maxX - minX + 1;
|
||||
this.y_size = maxY - minY + 1;
|
||||
this.z_size = maxZ - minZ + 1;
|
||||
|
||||
this.x_offset = minX;
|
||||
this.y_offset = minY;
|
||||
this.z_offset = minZ;
|
||||
this.x_offset = minX;
|
||||
this.y_offset = minY;
|
||||
this.z_offset = minZ;
|
||||
|
||||
final int minCX = minX >> 4;
|
||||
final int minCY = minY >> 4;
|
||||
final int minCZ = minZ >> 4;
|
||||
final int maxCX = maxX >> 4;
|
||||
final int maxCY = maxY >> 4;
|
||||
final int maxCZ = maxZ >> 4;
|
||||
final int minCX = minX >> 4;
|
||||
final int minCY = minY >> 4;
|
||||
final int minCZ = minZ >> 4;
|
||||
final int maxCX = maxX >> 4;
|
||||
final int maxCY = maxY >> 4;
|
||||
final int maxCZ = maxZ >> 4;
|
||||
|
||||
this.cx_size = maxCX - minCX + 1;
|
||||
final int cy_size = maxCY - minCY + 1;
|
||||
this.cz_size = maxCZ - minCZ + 1;
|
||||
this.cx_size = maxCX - minCX + 1;
|
||||
final int cy_size = maxCY - minCY + 1;
|
||||
this.cz_size = maxCZ - minCZ + 1;
|
||||
|
||||
this.myChunks = new Chunk[this.cx_size][this.cz_size];
|
||||
this.myColumns = new Column[this.x_size][this.z_size];
|
||||
this.myChunks = new Chunk[this.cx_size][this.cz_size];
|
||||
this.myColumns = new Column[this.x_size][this.z_size];
|
||||
|
||||
this.verticalBits = 0;
|
||||
for( int cy = 0; cy < cy_size; cy++ )
|
||||
{
|
||||
this.verticalBits |= 1 << ( minCY + cy );
|
||||
}
|
||||
this.verticalBits = 0;
|
||||
for (int cy = 0; cy < cy_size; cy++) {
|
||||
this.verticalBits |= 1 << (minCY + cy);
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.x_size; x++ )
|
||||
{
|
||||
for( int z = 0; z < this.z_size; z++ )
|
||||
{
|
||||
this.myColumns[x][z] = new Column( w.getChunkFromChunkCoords( ( minX + x ) >> 4,
|
||||
( minZ + z ) >> 4 ), ( minX + x ) & 0xF, ( minZ + z ) & 0xF, minCY, cy_size );
|
||||
}
|
||||
}
|
||||
for (int x = 0; x < this.x_size; x++) {
|
||||
for (int z = 0; z < this.z_size; z++) {
|
||||
this.myColumns[x][z] = new Column(w.getChunkFromChunkCoords((minX + x) >> 4,
|
||||
(minZ + z) >> 4), (minX + x) & 0xF, (minZ + z) & 0xF, minCY, cy_size);
|
||||
}
|
||||
}
|
||||
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
|
||||
for( int cx = 0; cx < this.cx_size; cx++ )
|
||||
{
|
||||
for( int cz = 0; cz < this.cz_size; cz++ )
|
||||
{
|
||||
final List<Entry<BlockPos, TileEntity>> rawTiles = new ArrayList<>();
|
||||
final List<BlockPos> deadTiles = new ArrayList<>();
|
||||
for (int cx = 0; cx < this.cx_size; cx++) {
|
||||
for (int cz = 0; cz < this.cz_size; cz++) {
|
||||
final List<Entry<BlockPos, TileEntity>> rawTiles = new ArrayList<>();
|
||||
final List<BlockPos> deadTiles = new ArrayList<>();
|
||||
|
||||
final Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz );
|
||||
this.myChunks[cx][cz] = c;
|
||||
final Chunk c = w.getChunkFromChunkCoords(minCX + cx, minCZ + cz);
|
||||
this.myChunks[cx][cz] = c;
|
||||
|
||||
rawTiles.addAll( ( (HashMap<BlockPos, TileEntity>) c.getTileEntityMap() ).entrySet() );
|
||||
for( final Entry<BlockPos, TileEntity> tx : rawTiles )
|
||||
{
|
||||
final BlockPos cp = tx.getKey();
|
||||
final TileEntity te = tx.getValue();
|
||||
rawTiles.addAll(c.getTileEntityMap().entrySet());
|
||||
for (final Entry<BlockPos, TileEntity> tx : rawTiles) {
|
||||
final BlockPos cp = tx.getKey();
|
||||
final TileEntity te = tx.getValue();
|
||||
|
||||
final BlockPos tePOS = te.getPos();
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS
|
||||
.getZ() <= maxZ )
|
||||
{
|
||||
if( mr.askToMove( te ) )
|
||||
{
|
||||
this.tiles.add( te );
|
||||
deadTiles.add( cp );
|
||||
}
|
||||
else
|
||||
{
|
||||
final BlockStorageData details = new BlockStorageData();
|
||||
this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].fillData( tePOS.getY(), details );
|
||||
final BlockPos tePOS = te.getPos();
|
||||
if (tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS
|
||||
.getZ() <= maxZ) {
|
||||
if (mr.askToMove(te)) {
|
||||
this.tiles.add(te);
|
||||
deadTiles.add(cp);
|
||||
} else {
|
||||
final BlockStorageData details = new BlockStorageData();
|
||||
this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].fillData(tePOS.getY(), details);
|
||||
|
||||
// don't skip air, just let the code replace it...
|
||||
if( details.state != null && details.state.getBlock() == Platform.AIR_BLOCK && details.state.getMaterial().isReplaceable() )
|
||||
{
|
||||
w.setBlockToAir( tePOS );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].setSkip( tePOS.getY() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// don't skip air, just let the code replace it...
|
||||
if (details.state != null && details.state.getBlock() == Platform.AIR_BLOCK && details.state.getMaterial().isReplaceable()) {
|
||||
w.setBlockToAir(tePOS);
|
||||
} else {
|
||||
this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].setSkip(tePOS.getY());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( final BlockPos cp : deadTiles )
|
||||
{
|
||||
c.getTileEntityMap().remove( cp );
|
||||
}
|
||||
for (final BlockPos cp : deadTiles) {
|
||||
c.getTileEntityMap().remove(cp);
|
||||
}
|
||||
|
||||
final long k = this.getWorld().getTotalWorldTime();
|
||||
final List<NextTickListEntry> list = this.getWorld().getPendingBlockUpdates( c, false );
|
||||
if( list != null )
|
||||
{
|
||||
for( final NextTickListEntry entry : list )
|
||||
{
|
||||
final BlockPos tePOS = entry.position;
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS
|
||||
.getZ() <= maxZ )
|
||||
{
|
||||
final NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() );
|
||||
newEntry.scheduledTime = entry.scheduledTime - k;
|
||||
this.ticks.add( newEntry );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
final long k = this.getWorld().getTotalWorldTime();
|
||||
final List<NextTickListEntry> list = this.getWorld().getPendingBlockUpdates(c, false);
|
||||
if (list != null) {
|
||||
for (final NextTickListEntry entry : list) {
|
||||
final BlockPos tePOS = entry.position;
|
||||
if (tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS
|
||||
.getZ() <= maxZ) {
|
||||
final NextTickListEntry newEntry = new NextTickListEntry(tePOS, entry.getBlock());
|
||||
newEntry.scheduledTime = entry.scheduledTime - k;
|
||||
this.ticks.add(newEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( final TileEntity te : this.tiles )
|
||||
{
|
||||
try
|
||||
{
|
||||
this.getWorld().loadedTileEntityList.remove( te );
|
||||
if( te instanceof ITickable )
|
||||
{
|
||||
this.getWorld().tickableTileEntities.remove( te );
|
||||
}
|
||||
}
|
||||
catch( final Exception e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final TileEntity te : this.tiles) {
|
||||
try {
|
||||
this.getWorld().loadedTileEntityList.remove(te);
|
||||
if (te instanceof ITickable) {
|
||||
this.getWorld().tickableTileEntities.remove(te);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IMovableHandler getHandler( final TileEntity te )
|
||||
{
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
return mr.getHandler( te );
|
||||
}
|
||||
private IMovableHandler getHandler(final TileEntity te) {
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
return mr.getHandler(te);
|
||||
}
|
||||
|
||||
void swap( final CachedPlane dst )
|
||||
{
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
void swap(final CachedPlane dst) {
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
|
||||
if( dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size )
|
||||
{
|
||||
AELog.info( "Block Copy Scale: " + this.x_size + ", " + this.y_size + ", " + this.z_size );
|
||||
if (dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size) {
|
||||
AELog.info("Block Copy Scale: " + this.x_size + ", " + this.y_size + ", " + this.z_size);
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
final BlockStorageData aD = new BlockStorageData();
|
||||
final BlockStorageData bD = new BlockStorageData();
|
||||
long startTime = System.nanoTime();
|
||||
final BlockStorageData aD = new BlockStorageData();
|
||||
final BlockStorageData bD = new BlockStorageData();
|
||||
|
||||
for( int x = 0; x < this.x_size; x++ )
|
||||
{
|
||||
for( int z = 0; z < this.z_size; z++ )
|
||||
{
|
||||
final Column a = this.myColumns[x][z];
|
||||
final Column b = dst.myColumns[x][z];
|
||||
for (int x = 0; x < this.x_size; x++) {
|
||||
for (int z = 0; z < this.z_size; z++) {
|
||||
final Column a = this.myColumns[x][z];
|
||||
final Column b = dst.myColumns[x][z];
|
||||
|
||||
for( int y = 0; y < this.y_size; y++ )
|
||||
{
|
||||
final int src_y = y + this.y_offset;
|
||||
final int dst_y = y + dst.y_offset;
|
||||
for (int y = 0; y < this.y_size; y++) {
|
||||
final int src_y = y + this.y_offset;
|
||||
final int dst_y = y + dst.y_offset;
|
||||
|
||||
if( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) )
|
||||
{
|
||||
a.fillData( src_y, aD );
|
||||
b.fillData( dst_y, bD );
|
||||
if (a.doNotSkip(src_y) && b.doNotSkip(dst_y)) {
|
||||
a.fillData(src_y, aD);
|
||||
b.fillData(dst_y, bD);
|
||||
|
||||
a.setBlockIDWithMetadata( src_y, bD );
|
||||
b.setBlockIDWithMetadata( dst_y, aD );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.markForUpdate( x + this.x_offset, src_y, z + this.z_offset );
|
||||
dst.markForUpdate( x + dst.x_offset, dst_y, z + dst.z_offset );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
a.setBlockIDWithMetadata(src_y, bD);
|
||||
b.setBlockIDWithMetadata(dst_y, aD);
|
||||
} else {
|
||||
this.markForUpdate(x + this.x_offset, src_y, z + this.z_offset);
|
||||
dst.markForUpdate(x + dst.x_offset, dst_y, z + dst.z_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long endTime = System.nanoTime();
|
||||
long duration = endTime - startTime;
|
||||
AELog.info( "Block Copy Time: " + duration );
|
||||
long endTime = System.nanoTime();
|
||||
long duration = endTime - startTime;
|
||||
AELog.info("Block Copy Time: " + duration);
|
||||
|
||||
for( final TileEntity te : this.tiles )
|
||||
{
|
||||
final BlockPos tePOS = te.getPos();
|
||||
dst.addTile( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, te, this, mr );
|
||||
}
|
||||
for (final TileEntity te : this.tiles) {
|
||||
final BlockPos tePOS = te.getPos();
|
||||
dst.addTile(tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, te, this, mr);
|
||||
}
|
||||
|
||||
for( final TileEntity te : dst.tiles )
|
||||
{
|
||||
final BlockPos tePOS = te.getPos();
|
||||
this.addTile( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, te, dst, mr );
|
||||
}
|
||||
for (final TileEntity te : dst.tiles) {
|
||||
final BlockPos tePOS = te.getPos();
|
||||
this.addTile(tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, te, dst, mr);
|
||||
}
|
||||
|
||||
for( final NextTickListEntry entry : this.ticks )
|
||||
{
|
||||
final BlockPos tePOS = entry.position;
|
||||
dst.addTick( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, entry );
|
||||
}
|
||||
for (final NextTickListEntry entry : this.ticks) {
|
||||
final BlockPos tePOS = entry.position;
|
||||
dst.addTick(tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, entry);
|
||||
}
|
||||
|
||||
for( final NextTickListEntry entry : dst.ticks )
|
||||
{
|
||||
final BlockPos tePOS = entry.position;
|
||||
this.addTick( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, entry );
|
||||
}
|
||||
for (final NextTickListEntry entry : dst.ticks) {
|
||||
final BlockPos tePOS = entry.position;
|
||||
this.addTick(tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, entry);
|
||||
}
|
||||
|
||||
startTime = System.nanoTime();
|
||||
this.updateChunks();
|
||||
dst.updateChunks();
|
||||
endTime = System.nanoTime();
|
||||
startTime = System.nanoTime();
|
||||
this.updateChunks();
|
||||
dst.updateChunks();
|
||||
endTime = System.nanoTime();
|
||||
|
||||
duration = endTime - startTime;
|
||||
AELog.info( "Update Time: " + duration );
|
||||
}
|
||||
}
|
||||
duration = endTime - startTime;
|
||||
AELog.info("Update Time: " + duration);
|
||||
}
|
||||
}
|
||||
|
||||
private void markForUpdate( final int x, final int y, final int z )
|
||||
{
|
||||
this.updates.add( new WorldCoord( x, y, z ) );
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.updates.add( new WorldCoord( x + d.xOffset, y + d.yOffset, z + d.zOffset ) );
|
||||
}
|
||||
}
|
||||
private void markForUpdate(final int x, final int y, final int z) {
|
||||
this.updates.add(new WorldCoord(x, y, z));
|
||||
for (final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS) {
|
||||
this.updates.add(new WorldCoord(x + d.xOffset, y + d.yOffset, z + d.zOffset));
|
||||
}
|
||||
}
|
||||
|
||||
private void addTick( final int x, final int y, final int z, final NextTickListEntry entry )
|
||||
{
|
||||
this.world.scheduleUpdate( new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ), entry.getBlock(), (int) entry.scheduledTime );
|
||||
}
|
||||
private void addTick(final int x, final int y, final int z, final NextTickListEntry entry) {
|
||||
this.world.scheduleUpdate(new BlockPos(x + this.x_offset, y + this.y_offset, z + this.z_offset), entry.getBlock(), (int) entry.scheduledTime);
|
||||
}
|
||||
|
||||
private void addTile( final int x, final int y, final int z, final TileEntity te, final CachedPlane alternateDestination, final IMovableRegistry mr )
|
||||
{
|
||||
try
|
||||
{
|
||||
final Column c = this.myColumns[x][z];
|
||||
private void addTile(final int x, final int y, final int z, final TileEntity te, final CachedPlane alternateDestination, final IMovableRegistry mr) {
|
||||
try {
|
||||
final Column c = this.myColumns[x][z];
|
||||
|
||||
if( c.doNotSkip( y + this.y_offset ) || alternateDestination == null )
|
||||
{
|
||||
final IMovableHandler handler = this.getHandler( te );
|
||||
if (c.doNotSkip(y + this.y_offset) || alternateDestination == null) {
|
||||
final IMovableHandler handler = this.getHandler(te);
|
||||
|
||||
try
|
||||
{
|
||||
handler.moveTile( te, this.world, new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ) );
|
||||
}
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
try {
|
||||
handler.moveTile(te, this.world, new BlockPos(x + this.x_offset, y + this.y_offset, z + this.z_offset));
|
||||
} catch (final Throwable e) {
|
||||
AELog.debug(e);
|
||||
|
||||
final BlockPos pos = new BlockPos( x, y, z );
|
||||
final BlockPos pos = new BlockPos(x, y, z);
|
||||
|
||||
// attempt recovery...
|
||||
te.setWorld( this.world );
|
||||
te.setPos( pos );
|
||||
c.c.addTileEntity( new BlockPos( c.x, y + y, c.z ), te );
|
||||
// c.c.setChunkTileEntity( c.x, y + y, c.z, te );
|
||||
// attempt recovery...
|
||||
te.setWorld(this.world);
|
||||
te.setPos(pos);
|
||||
c.c.addTileEntity(new BlockPos(c.x, y + y, c.z), te);
|
||||
// c.c.setChunkTileEntity( c.x, y + y, c.z, te );
|
||||
|
||||
if( c.c.isLoaded() )
|
||||
{
|
||||
this.world.addTileEntity( te );
|
||||
this.world.notifyBlockUpdate( pos, this.world.getBlockState( pos ), this.world.getBlockState( pos ), z );
|
||||
}
|
||||
}
|
||||
if (c.c.isLoaded()) {
|
||||
this.world.addTileEntity(te);
|
||||
this.world.notifyBlockUpdate(pos, this.world.getBlockState(pos), this.world.getBlockState(pos), z);
|
||||
}
|
||||
}
|
||||
|
||||
mr.doneMoving( te );
|
||||
}
|
||||
else
|
||||
{
|
||||
alternateDestination.addTile( x, y, z, te, null, mr );
|
||||
}
|
||||
}
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
mr.doneMoving(te);
|
||||
} else {
|
||||
alternateDestination.addTile(x, y, z, te, null, mr);
|
||||
}
|
||||
} catch (final Throwable e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateChunks()
|
||||
{
|
||||
private void updateChunks() {
|
||||
|
||||
// update shit..
|
||||
for( int x = 0; x < this.cx_size; x++ )
|
||||
{
|
||||
for( int z = 0; z < this.cz_size; z++ )
|
||||
{
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
c.resetRelightChecks();
|
||||
c.generateSkylightMap();
|
||||
c.setModified( true );
|
||||
}
|
||||
}
|
||||
// update shit..
|
||||
for (int x = 0; x < this.cx_size; x++) {
|
||||
for (int z = 0; z < this.cz_size; z++) {
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
c.resetRelightChecks();
|
||||
c.generateSkylightMap();
|
||||
c.setModified(true);
|
||||
}
|
||||
}
|
||||
|
||||
// send shit...
|
||||
for( int x = 0; x < this.cx_size; x++ )
|
||||
{
|
||||
for( int z = 0; z < this.cz_size; z++ )
|
||||
{
|
||||
// send shit...
|
||||
for (int x = 0; x < this.cx_size; x++) {
|
||||
for (int z = 0; z < this.cz_size; z++) {
|
||||
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
|
||||
for( int y = 1; y < 255; y += 32 )
|
||||
{
|
||||
WorldData.instance().compassData().service().updateArea( this.getWorld(), c.x << 4, y, c.z << 4 );
|
||||
}
|
||||
for (int y = 1; y < 255; y += 32) {
|
||||
WorldData.instance().compassData().service().updateArea(this.getWorld(), c.x << 4, y, c.z << 4);
|
||||
}
|
||||
|
||||
Platform.sendChunk( c, this.verticalBits );
|
||||
}
|
||||
}
|
||||
}
|
||||
Platform.sendChunk(c, this.verticalBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<WorldCoord> getUpdates()
|
||||
{
|
||||
return this.updates;
|
||||
}
|
||||
List<WorldCoord> getUpdates() {
|
||||
return this.updates;
|
||||
}
|
||||
|
||||
World getWorld()
|
||||
{
|
||||
return this.world;
|
||||
}
|
||||
World getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
|
||||
private static class BlockStorageData
|
||||
{
|
||||
public IBlockState state;
|
||||
public int light;
|
||||
}
|
||||
private static class BlockStorageData {
|
||||
public IBlockState state;
|
||||
public int light;
|
||||
}
|
||||
|
||||
private class Column
|
||||
{
|
||||
private final int x;
|
||||
private final int z;
|
||||
private final Chunk c;
|
||||
private List<Integer> skipThese = null;
|
||||
private class Column {
|
||||
private final int x;
|
||||
private final int z;
|
||||
private final Chunk c;
|
||||
private List<Integer> skipThese = null;
|
||||
|
||||
public Column( final Chunk chunk, final int x, final int z, final int chunkY, final int chunkHeight )
|
||||
{
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.c = chunk;
|
||||
public Column(final Chunk chunk, final int x, final int z, final int chunkY, final int chunkHeight) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.c = chunk;
|
||||
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
|
||||
// make sure storage exists before hand...
|
||||
for( int ay = 0; ay < chunkHeight; ay++ )
|
||||
{
|
||||
final int by = ( ay + chunkY );
|
||||
ExtendedBlockStorage extendedblockstorage = storage[by];
|
||||
if( extendedblockstorage == null )
|
||||
{
|
||||
extendedblockstorage = storage[by] = new ExtendedBlockStorage( by << 4, this.c.getWorld().provider.hasSkyLight() );
|
||||
}
|
||||
}
|
||||
}
|
||||
// make sure storage exists before hand...
|
||||
for (int ay = 0; ay < chunkHeight; ay++) {
|
||||
final int by = (ay + chunkY);
|
||||
ExtendedBlockStorage extendedblockstorage = storage[by];
|
||||
if (extendedblockstorage == null) {
|
||||
extendedblockstorage = storage[by] = new ExtendedBlockStorage(by << 4, this.c.getWorld().provider.hasSkyLight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setBlockIDWithMetadata( final int y, BlockStorageData data )
|
||||
{
|
||||
if( data.state == CachedPlane.this.matrixBlockState )
|
||||
{
|
||||
data.state = Platform.AIR_BLOCK.getDefaultState();
|
||||
}
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedBlockStorage = storage[y >> 4];
|
||||
extendedBlockStorage.set( this.x, y & 15, this.z, data.state );
|
||||
extendedBlockStorage.setBlockLight( this.x, y & 15, this.z, data.light );
|
||||
}
|
||||
private void setBlockIDWithMetadata(final int y, BlockStorageData data) {
|
||||
if (data.state == CachedPlane.this.matrixBlockState) {
|
||||
data.state = Platform.AIR_BLOCK.getDefaultState();
|
||||
}
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedBlockStorage = storage[y >> 4];
|
||||
extendedBlockStorage.set(this.x, y & 15, this.z, data.state);
|
||||
extendedBlockStorage.setBlockLight(this.x, y & 15, this.z, data.light);
|
||||
}
|
||||
|
||||
private void fillData( final int y, BlockStorageData data )
|
||||
{
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedblockstorage = storage[y >> 4];
|
||||
private void fillData(final int y, BlockStorageData data) {
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedblockstorage = storage[y >> 4];
|
||||
|
||||
data.state = extendedblockstorage.get( this.x, y & 15, this.z );
|
||||
data.light = extendedblockstorage.getBlockLight( this.x, y & 15, this.z );
|
||||
}
|
||||
data.state = extendedblockstorage.get(this.x, y & 15, this.z);
|
||||
data.light = extendedblockstorage.getBlockLight(this.x, y & 15, this.z);
|
||||
}
|
||||
|
||||
private boolean doNotSkip( final int y )
|
||||
{
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedblockstorage = storage[y >> 4];
|
||||
if( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.get( this.x, y & 15, this.z ).getBlock() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private boolean doNotSkip(final int y) {
|
||||
final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray();
|
||||
final ExtendedBlockStorage extendedblockstorage = storage[y >> 4];
|
||||
if (CachedPlane.this.reg.isBlacklisted(extendedblockstorage.get(this.x, y & 15, this.z).getBlock())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.skipThese == null || !this.skipThese.contains( y );
|
||||
}
|
||||
return this.skipThese == null || !this.skipThese.contains(y);
|
||||
}
|
||||
|
||||
private void setSkip( final int yCoord )
|
||||
{
|
||||
if( this.skipThese == null )
|
||||
{
|
||||
this.skipThese = new ArrayList<>();
|
||||
}
|
||||
this.skipThese.add( yCoord );
|
||||
}
|
||||
}
|
||||
private void setSkip(final int yCoord) {
|
||||
if (this.skipThese == null) {
|
||||
this.skipThese = new ArrayList<>();
|
||||
}
|
||||
this.skipThese.add(yCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,45 +19,39 @@
|
||||
package appeng.spatial;
|
||||
|
||||
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
|
||||
public class DefaultSpatialHandler implements IMovableHandler {
|
||||
|
||||
public class DefaultSpatialHandler implements IMovableHandler
|
||||
{
|
||||
/**
|
||||
* never called for the default.
|
||||
*
|
||||
* @param tile tile entity
|
||||
* @return true
|
||||
*/
|
||||
@Override
|
||||
public boolean canHandle(final Class<? extends TileEntity> myClass, final TileEntity tile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* never called for the default.
|
||||
*
|
||||
* @param tile tile entity
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
@Override
|
||||
public boolean canHandle( final Class<? extends TileEntity> myClass, final TileEntity tile )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void moveTile(final TileEntity te, final World w, final BlockPos newPosition) {
|
||||
te.setWorld(w);
|
||||
te.setPos(newPosition);
|
||||
|
||||
@Override
|
||||
public void moveTile( final TileEntity te, final World w, final BlockPos newPosition )
|
||||
{
|
||||
te.setWorld( w );
|
||||
te.setPos( newPosition );
|
||||
final Chunk c = w.getChunkFromBlockCoords(newPosition);
|
||||
c.addTileEntity(newPosition, te);
|
||||
|
||||
final Chunk c = w.getChunkFromBlockCoords( newPosition );
|
||||
c.addTileEntity( newPosition, te );
|
||||
|
||||
if( c.isLoaded() )
|
||||
{
|
||||
final IBlockState state = w.getBlockState( newPosition );
|
||||
w.addTileEntity( te );
|
||||
w.notifyBlockUpdate( newPosition, state, state, 1 );
|
||||
}
|
||||
}
|
||||
if (c.isLoaded()) {
|
||||
final IBlockState state = w.getBlockState(newPosition);
|
||||
w.addTileEntity(te);
|
||||
w.notifyBlockUpdate(newPosition, state, state, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,7 @@ package appeng.spatial;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
public interface ISpatialVisitor
|
||||
{
|
||||
public interface ISpatialVisitor {
|
||||
|
||||
void visit( BlockPos pos );
|
||||
void visit(BlockPos pos);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
package appeng.spatial;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.AppEng;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -30,89 +29,75 @@ import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.ChunkGeneratorOverworld;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.AppEng;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class StorageChunkProvider extends ChunkGeneratorOverworld
|
||||
{
|
||||
public class StorageChunkProvider extends ChunkGeneratorOverworld {
|
||||
|
||||
private final World world;
|
||||
private final World world;
|
||||
|
||||
public StorageChunkProvider( final World world, final long i )
|
||||
{
|
||||
super( world, i, false, null );
|
||||
this.world = world;
|
||||
}
|
||||
public StorageChunkProvider(final World world, final long i) {
|
||||
super(world, i, false, null);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk generateChunk( final int x, final int z )
|
||||
{
|
||||
final Chunk chunk = new Chunk( this.world, x, z );
|
||||
@Override
|
||||
public Chunk generateChunk(final int x, final int z) {
|
||||
final Chunk chunk = new Chunk(this.world, x, z);
|
||||
|
||||
final byte[] biomes = chunk.getBiomeArray();
|
||||
Biome biome = AppEng.instance().getStorageBiome();
|
||||
byte biomeId = (byte) Biome.getIdForBiome( biome );
|
||||
final byte[] biomes = chunk.getBiomeArray();
|
||||
Biome biome = AppEng.instance().getStorageBiome();
|
||||
byte biomeId = (byte) Biome.getIdForBiome(biome);
|
||||
|
||||
for( int k = 0; k < biomes.length; ++k )
|
||||
{
|
||||
biomes[k] = biomeId;
|
||||
}
|
||||
for (int k = 0; k < biomes.length; ++k) {
|
||||
biomes[k] = biomeId;
|
||||
}
|
||||
|
||||
AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().ifPresent( block -> this.fillChunk( chunk, block.getDefaultState() ) );
|
||||
AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().ifPresent(block -> this.fillChunk(chunk, block.getDefaultState()));
|
||||
|
||||
chunk.setModified( false );
|
||||
chunk.setModified(false);
|
||||
|
||||
if( !chunk.isTerrainPopulated() )
|
||||
{
|
||||
chunk.setTerrainPopulated( true );
|
||||
chunk.resetRelightChecks();
|
||||
}
|
||||
if (!chunk.isTerrainPopulated()) {
|
||||
chunk.setTerrainPopulated(true);
|
||||
chunk.resetRelightChecks();
|
||||
}
|
||||
|
||||
return chunk;
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
|
||||
private void fillChunk( Chunk chunk, IBlockState defaultState )
|
||||
{
|
||||
for( int cx = 0; cx < 16; cx++ )
|
||||
{
|
||||
for( int cz = 0; cz < 16; cz++ )
|
||||
{
|
||||
for( int cy = 0; cy < 256; cy++ )
|
||||
{
|
||||
chunk.setBlockState( new BlockPos( cx, cy, cz ), defaultState );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void fillChunk(Chunk chunk, IBlockState defaultState) {
|
||||
for (int cx = 0; cx < 16; cx++) {
|
||||
for (int cz = 0; cz < 16; cz++) {
|
||||
for (int cy = 0; cy < 256; cy++) {
|
||||
chunk.setBlockState(new BlockPos(cx, cy, cz), defaultState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populate( final int par2, final int par3 )
|
||||
{
|
||||
@Override
|
||||
public void populate(final int par2, final int par3) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getPossibleCreatures( final EnumCreatureType creatureType, final BlockPos pos )
|
||||
{
|
||||
return new ArrayList();
|
||||
}
|
||||
@Override
|
||||
public List getPossibleCreatures(final EnumCreatureType creatureType, final BlockPos pos) {
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateStructures( Chunk chunkIn, int x, int z )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean generateStructures(Chunk chunkIn, int x, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getNearestStructurePos( World worldIn, String structureName, BlockPos position, boolean p_180513_4_ )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean p_180513_4_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateStructures( Chunk chunkIn, int x, int z )
|
||||
{
|
||||
@Override
|
||||
public void recreateStructures(Chunk chunkIn, int x, int z) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
package appeng.spatial;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -33,259 +34,217 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.ITeleporter;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.util.Platform;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class StorageHelper
|
||||
{
|
||||
public class StorageHelper {
|
||||
|
||||
private static StorageHelper instance;
|
||||
private static StorageHelper instance;
|
||||
|
||||
public static StorageHelper getInstance()
|
||||
{
|
||||
if( instance == null )
|
||||
{
|
||||
instance = new StorageHelper();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
public static StorageHelper getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new StorageHelper();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mostly from dimensional doors.. which mostly got it form X-Comp.
|
||||
*
|
||||
* @param entity to be teleported entity
|
||||
* @param link destination
|
||||
*
|
||||
* @return teleported entity
|
||||
*/
|
||||
private Entity teleportEntity( Entity entity, final TelDestination link )
|
||||
{
|
||||
final WorldServer oldWorld;
|
||||
final WorldServer newWorld;
|
||||
/**
|
||||
* Mostly from dimensional doors.. which mostly got it form X-Comp.
|
||||
*
|
||||
* @param entity to be teleported entity
|
||||
* @param link destination
|
||||
* @return teleported entity
|
||||
*/
|
||||
private Entity teleportEntity(Entity entity, final TelDestination link) {
|
||||
final WorldServer oldWorld;
|
||||
final WorldServer newWorld;
|
||||
|
||||
try
|
||||
{
|
||||
oldWorld = (WorldServer) entity.world;
|
||||
newWorld = (WorldServer) link.dim;
|
||||
}
|
||||
catch( final Throwable e )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
try {
|
||||
oldWorld = (WorldServer) entity.world;
|
||||
newWorld = (WorldServer) link.dim;
|
||||
} catch (final Throwable e) {
|
||||
return entity;
|
||||
}
|
||||
|
||||
if( oldWorld == null )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
if( newWorld == null )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
if( newWorld == oldWorld )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
if (oldWorld == null) {
|
||||
return entity;
|
||||
}
|
||||
if (newWorld == null) {
|
||||
return entity;
|
||||
}
|
||||
if (newWorld == oldWorld) {
|
||||
return entity;
|
||||
}
|
||||
|
||||
// Are we riding something? Teleport it instead.
|
||||
if( entity.isRiding() )
|
||||
{
|
||||
return this.teleportEntity( entity.getRidingEntity(), link );
|
||||
}
|
||||
// Are we riding something? Teleport it instead.
|
||||
if (entity.isRiding()) {
|
||||
return this.teleportEntity(entity.getRidingEntity(), link);
|
||||
}
|
||||
|
||||
// Is something riding us? Handle it first.
|
||||
final List<Entity> passangers = entity.getPassengers();
|
||||
final List<Entity> passangersOnOtherSide = new ArrayList<>();
|
||||
if( !passangers.isEmpty() )
|
||||
{
|
||||
for( Entity passanger : passangers )
|
||||
{
|
||||
passanger.dismountRidingEntity();
|
||||
passangersOnOtherSide.add( this.teleportEntity( passanger, link ) );
|
||||
}
|
||||
// We keep track of all so we can remount them on the other side.
|
||||
}
|
||||
// Is something riding us? Handle it first.
|
||||
final List<Entity> passangers = entity.getPassengers();
|
||||
final List<Entity> passangersOnOtherSide = new ArrayList<>();
|
||||
if (!passangers.isEmpty()) {
|
||||
for (Entity passanger : passangers) {
|
||||
passanger.dismountRidingEntity();
|
||||
passangersOnOtherSide.add(this.teleportEntity(passanger, link));
|
||||
}
|
||||
// We keep track of all so we can remount them on the other side.
|
||||
}
|
||||
|
||||
// load the chunk!
|
||||
newWorld.getChunkProvider().provideChunk( MathHelper.floor( link.x ) >> 4, MathHelper.floor( link.z ) >> 4 );
|
||||
// load the chunk!
|
||||
newWorld.getChunkProvider().provideChunk(MathHelper.floor(link.x) >> 4, MathHelper.floor(link.z) >> 4);
|
||||
|
||||
if( entity instanceof EntityPlayerMP && link.dim.provider instanceof StorageWorldProvider )
|
||||
{
|
||||
AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger( (EntityPlayerMP) entity );
|
||||
}
|
||||
if (entity instanceof EntityPlayerMP && link.dim.provider instanceof StorageWorldProvider) {
|
||||
AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger((EntityPlayerMP) entity);
|
||||
}
|
||||
|
||||
entity.changeDimension( link.dim.provider.getDimension(), new METeleporter( link ) );
|
||||
entity.changeDimension(link.dim.provider.getDimension(), new METeleporter(link));
|
||||
|
||||
if( !passangersOnOtherSide.isEmpty() )
|
||||
{
|
||||
for( Entity passanger : passangersOnOtherSide )
|
||||
{
|
||||
passanger.startRiding( entity, true );
|
||||
}
|
||||
}
|
||||
if (!passangersOnOtherSide.isEmpty()) {
|
||||
for (Entity passanger : passangersOnOtherSide) {
|
||||
passanger.startRiding(entity, true);
|
||||
}
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
private void transverseEdges( final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final ISpatialVisitor visitor )
|
||||
{
|
||||
for( int y = minY; y < maxY; y++ )
|
||||
{
|
||||
for( int z = minZ; z < maxZ; z++ )
|
||||
{
|
||||
visitor.visit( new BlockPos( minX, y, z ) );
|
||||
visitor.visit( new BlockPos( maxX, y, z ) );
|
||||
}
|
||||
}
|
||||
private void transverseEdges(final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final ISpatialVisitor visitor) {
|
||||
for (int y = minY; y < maxY; y++) {
|
||||
for (int z = minZ; z < maxZ; z++) {
|
||||
visitor.visit(new BlockPos(minX, y, z));
|
||||
visitor.visit(new BlockPos(maxX, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
for( int x = minX; x < maxX; x++ )
|
||||
{
|
||||
for( int z = minZ; z < maxZ; z++ )
|
||||
{
|
||||
visitor.visit( new BlockPos( x, minY, z ) );
|
||||
visitor.visit( new BlockPos( x, maxY, z ) );
|
||||
}
|
||||
}
|
||||
for (int x = minX; x < maxX; x++) {
|
||||
for (int z = minZ; z < maxZ; z++) {
|
||||
visitor.visit(new BlockPos(x, minY, z));
|
||||
visitor.visit(new BlockPos(x, maxY, z));
|
||||
}
|
||||
}
|
||||
|
||||
for( int x = minX; x < maxX; x++ )
|
||||
{
|
||||
for( int y = minY; y < maxY; y++ )
|
||||
{
|
||||
visitor.visit( new BlockPos( x, y, minZ ) );
|
||||
visitor.visit( new BlockPos( x, y, maxZ ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int x = minX; x < maxX; x++) {
|
||||
for (int y = minY; y < maxY; y++) {
|
||||
visitor.visit(new BlockPos(x, y, minZ));
|
||||
visitor.visit(new BlockPos(x, y, maxZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void swapRegions( final World srcWorld, final int srcX, final int srcY, final int srcZ, final World dstWorld, final int dstX, final int dstY, final int dstZ, final int scaleX, final int scaleY, final int scaleZ )
|
||||
{
|
||||
AEApi.instance()
|
||||
.definitions()
|
||||
.blocks()
|
||||
.matrixFrame()
|
||||
.maybeBlock()
|
||||
.ifPresent( matrixFrameBlock -> this.transverseEdges( dstX - 1, dstY - 1, dstZ - 1,
|
||||
dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1, new WrapInMatrixFrame( matrixFrameBlock.getDefaultState(), dstWorld ) ) );
|
||||
public void swapRegions(final World srcWorld, final int srcX, final int srcY, final int srcZ, final World dstWorld, final int dstX, final int dstY, final int dstZ, final int scaleX, final int scaleY, final int scaleZ) {
|
||||
AEApi.instance()
|
||||
.definitions()
|
||||
.blocks()
|
||||
.matrixFrame()
|
||||
.maybeBlock()
|
||||
.ifPresent(matrixFrameBlock -> this.transverseEdges(dstX - 1, dstY - 1, dstZ - 1,
|
||||
dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1, new WrapInMatrixFrame(matrixFrameBlock.getDefaultState(), dstWorld)));
|
||||
|
||||
final AxisAlignedBB srcBox = new AxisAlignedBB( srcX, srcY, srcZ, srcX + scaleX + 1, srcY + scaleY + 1, srcZ + scaleZ + 1 );
|
||||
final AxisAlignedBB srcBox = new AxisAlignedBB(srcX, srcY, srcZ, srcX + scaleX + 1, srcY + scaleY + 1, srcZ + scaleZ + 1);
|
||||
|
||||
final AxisAlignedBB dstBox = new AxisAlignedBB( dstX, dstY, dstZ, dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1 );
|
||||
final AxisAlignedBB dstBox = new AxisAlignedBB(dstX, dstY, dstZ, dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1);
|
||||
|
||||
final CachedPlane cDst = new CachedPlane( dstWorld, dstX, dstY, dstZ, dstX + scaleX, dstY + scaleY, dstZ + scaleZ );
|
||||
final CachedPlane cSrc = new CachedPlane( srcWorld, srcX, srcY, srcZ, srcX + scaleX, srcY + scaleY, srcZ + scaleZ );
|
||||
final CachedPlane cDst = new CachedPlane(dstWorld, dstX, dstY, dstZ, dstX + scaleX, dstY + scaleY, dstZ + scaleZ);
|
||||
final CachedPlane cSrc = new CachedPlane(srcWorld, srcX, srcY, srcZ, srcX + scaleX, srcY + scaleY, srcZ + scaleZ);
|
||||
|
||||
// do nearly all the work... swaps blocks, tiles, and block ticks
|
||||
cSrc.swap( cDst );
|
||||
// do nearly all the work... swaps blocks, tiles, and block ticks
|
||||
cSrc.swap(cDst);
|
||||
|
||||
final List<Entity> srcE = srcWorld.getEntitiesWithinAABB( Entity.class, srcBox );
|
||||
final List<Entity> dstE = dstWorld.getEntitiesWithinAABB( Entity.class, dstBox );
|
||||
final List<Entity> srcE = srcWorld.getEntitiesWithinAABB(Entity.class, srcBox);
|
||||
final List<Entity> dstE = dstWorld.getEntitiesWithinAABB(Entity.class, dstBox);
|
||||
|
||||
for( final Entity e : dstE )
|
||||
{
|
||||
this.teleportEntity( e, new TelDestination( srcWorld, srcBox, e.posX, e.posY, e.posZ, -dstX + srcX, -dstY + srcY, -dstZ + srcZ ) );
|
||||
}
|
||||
for (final Entity e : dstE) {
|
||||
this.teleportEntity(e, new TelDestination(srcWorld, srcBox, e.posX, e.posY, e.posZ, -dstX + srcX, -dstY + srcY, -dstZ + srcZ));
|
||||
}
|
||||
|
||||
for( final Entity e : srcE )
|
||||
{
|
||||
this.teleportEntity( e, new TelDestination( dstWorld, dstBox, e.posX, e.posY, e.posZ, -srcX + dstX, -srcY + dstY, -srcZ + dstZ ) );
|
||||
}
|
||||
for (final Entity e : srcE) {
|
||||
this.teleportEntity(e, new TelDestination(dstWorld, dstBox, e.posX, e.posY, e.posZ, -srcX + dstX, -srcY + dstY, -srcZ + dstZ));
|
||||
}
|
||||
|
||||
for( final WorldCoord wc : cDst.getUpdates() )
|
||||
{
|
||||
cSrc.getWorld().notifyNeighborsOfStateChange( wc.getPos(), Platform.AIR_BLOCK, true );
|
||||
}
|
||||
for (final WorldCoord wc : cDst.getUpdates()) {
|
||||
cSrc.getWorld().notifyNeighborsOfStateChange(wc.getPos(), Platform.AIR_BLOCK, true);
|
||||
}
|
||||
|
||||
for( final WorldCoord wc : cSrc.getUpdates() )
|
||||
{
|
||||
cSrc.getWorld().notifyNeighborsOfStateChange( wc.getPos(), Platform.AIR_BLOCK, true );
|
||||
}
|
||||
for (final WorldCoord wc : cSrc.getUpdates()) {
|
||||
cSrc.getWorld().notifyNeighborsOfStateChange(wc.getPos(), Platform.AIR_BLOCK, true);
|
||||
}
|
||||
|
||||
this.transverseEdges( srcX - 1, srcY - 1, srcZ - 1, srcX + scaleX + 1, srcY + scaleY + 1, srcZ + scaleZ + 1, new TriggerUpdates( srcWorld ) );
|
||||
this.transverseEdges( dstX - 1, dstY - 1, dstZ - 1, dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1, new TriggerUpdates( dstWorld ) );
|
||||
this.transverseEdges(srcX - 1, srcY - 1, srcZ - 1, srcX + scaleX + 1, srcY + scaleY + 1, srcZ + scaleZ + 1, new TriggerUpdates(srcWorld));
|
||||
this.transverseEdges(dstX - 1, dstY - 1, dstZ - 1, dstX + scaleX + 1, dstY + scaleY + 1, dstZ + scaleZ + 1, new TriggerUpdates(dstWorld));
|
||||
|
||||
this.transverseEdges( srcX, srcY, srcZ, srcX + scaleX, srcY + scaleY, srcZ + scaleZ, new TriggerUpdates( srcWorld ) );
|
||||
this.transverseEdges( dstX, dstY, dstZ, dstX + scaleX, dstY + scaleY, dstZ + scaleZ, new TriggerUpdates( dstWorld ) );
|
||||
this.transverseEdges(srcX, srcY, srcZ, srcX + scaleX, srcY + scaleY, srcZ + scaleZ, new TriggerUpdates(srcWorld));
|
||||
this.transverseEdges(dstX, dstY, dstZ, dstX + scaleX, dstY + scaleY, dstZ + scaleZ, new TriggerUpdates(dstWorld));
|
||||
|
||||
/*
|
||||
* IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) {
|
||||
* ChunkProviderServer
|
||||
* srv = (ChunkProviderServer) cp; srv.unloadAllChunks(); }
|
||||
* cp.unloadQueuedChunks();
|
||||
*/
|
||||
/*
|
||||
* IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) {
|
||||
* ChunkProviderServer
|
||||
* srv = (ChunkProviderServer) cp; srv.unloadAllChunks(); }
|
||||
* cp.unloadQueuedChunks();
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static class TriggerUpdates implements ISpatialVisitor
|
||||
{
|
||||
private static class TriggerUpdates implements ISpatialVisitor {
|
||||
|
||||
private final World dst;
|
||||
private final World dst;
|
||||
|
||||
public TriggerUpdates( final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
}
|
||||
public TriggerUpdates(final World dst2) {
|
||||
this.dst = dst2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( final BlockPos pos )
|
||||
{
|
||||
final IBlockState state = this.dst.getBlockState( pos );
|
||||
final Block blk = state.getBlock();
|
||||
blk.neighborChanged( state, this.dst, pos, blk, pos );
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void visit(final BlockPos pos) {
|
||||
final IBlockState state = this.dst.getBlockState(pos);
|
||||
final Block blk = state.getBlock();
|
||||
blk.neighborChanged(state, this.dst, pos, blk, pos);
|
||||
}
|
||||
}
|
||||
|
||||
private static class WrapInMatrixFrame implements ISpatialVisitor
|
||||
{
|
||||
private static class WrapInMatrixFrame implements ISpatialVisitor {
|
||||
|
||||
private final World dst;
|
||||
private final IBlockState state;
|
||||
private final World dst;
|
||||
private final IBlockState state;
|
||||
|
||||
public WrapInMatrixFrame( final IBlockState state, final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
this.state = state;
|
||||
}
|
||||
public WrapInMatrixFrame(final IBlockState state, final World dst2) {
|
||||
this.dst = dst2;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( final BlockPos pos )
|
||||
{
|
||||
this.dst.setBlockState( pos, this.state );
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void visit(final BlockPos pos) {
|
||||
this.dst.setBlockState(pos, this.state);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TelDestination
|
||||
{
|
||||
private final World dim;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
private static class TelDestination {
|
||||
private final World dim;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
|
||||
TelDestination( final World dimension, final AxisAlignedBB srcBox, final double x, final double y, final double z, final int tileX, final int tileY, final int tileZ )
|
||||
{
|
||||
this.dim = dimension;
|
||||
this.x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, x + tileX ) );
|
||||
this.y = Math.min( srcBox.maxY - 0.5, Math.max( srcBox.minY + 0.5, y + tileY ) );
|
||||
this.z = Math.min( srcBox.maxZ - 0.5, Math.max( srcBox.minZ + 0.5, z + tileZ ) );
|
||||
}
|
||||
}
|
||||
TelDestination(final World dimension, final AxisAlignedBB srcBox, final double x, final double y, final double z, final int tileX, final int tileY, final int tileZ) {
|
||||
this.dim = dimension;
|
||||
this.x = Math.min(srcBox.maxX - 0.5, Math.max(srcBox.minX + 0.5, x + tileX));
|
||||
this.y = Math.min(srcBox.maxY - 0.5, Math.max(srcBox.minY + 0.5, y + tileY));
|
||||
this.z = Math.min(srcBox.maxZ - 0.5, Math.max(srcBox.minZ + 0.5, z + tileZ));
|
||||
}
|
||||
}
|
||||
|
||||
private static class METeleporter implements ITeleporter
|
||||
{
|
||||
private static class METeleporter implements ITeleporter {
|
||||
|
||||
private final TelDestination destination;
|
||||
private final TelDestination destination;
|
||||
|
||||
METeleporter( final TelDestination d )
|
||||
{
|
||||
this.destination = d;
|
||||
}
|
||||
METeleporter(final TelDestination d) {
|
||||
this.destination = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeEntity( World world, Entity entity, float yaw )
|
||||
{
|
||||
entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, yaw, entity.rotationPitch );
|
||||
entity.motionX = entity.motionY = entity.motionZ = 0.0D;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void placeEntity(World world, Entity entity, float yaw) {
|
||||
entity.setLocationAndAngles(this.destination.x, this.destination.y, this.destination.z, yaw, entity.rotationPitch);
|
||||
entity.motionX = entity.motionY = entity.motionZ = 0.0D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
package appeng.spatial;
|
||||
|
||||
|
||||
import appeng.client.render.SpatialSkyRender;
|
||||
import appeng.core.AppEng;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -32,130 +34,107 @@ import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.client.render.SpatialSkyRender;
|
||||
import appeng.core.AppEng;
|
||||
|
||||
public class StorageWorldProvider extends WorldProvider {
|
||||
|
||||
public class StorageWorldProvider extends WorldProvider
|
||||
{
|
||||
private final Biome biome;
|
||||
|
||||
private final Biome biome;
|
||||
public StorageWorldProvider() {
|
||||
this.hasSkyLight = true;
|
||||
this.biome = AppEng.instance().getStorageBiome();
|
||||
this.biomeProvider = new BiomeProviderSingle(this.biome);
|
||||
}
|
||||
|
||||
public StorageWorldProvider()
|
||||
{
|
||||
this.hasSkyLight = true;
|
||||
this.biome = AppEng.instance().getStorageBiome();
|
||||
this.biomeProvider = new BiomeProviderSingle( this.biome );
|
||||
}
|
||||
@Override
|
||||
public IChunkGenerator createChunkGenerator() {
|
||||
return new StorageChunkProvider(this.world, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChunkGenerator createChunkGenerator()
|
||||
{
|
||||
return new StorageChunkProvider( this.world, 0 );
|
||||
}
|
||||
@Override
|
||||
public float calculateCelestialAngle(final long par1, final float par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle( final long par1, final float par3 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public boolean isSurfaceWorld() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSurfaceWorld()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float[] calcSunriseSunsetColors(final float celestialAngle, final float partialTicks) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public float[] calcSunriseSunsetColors( final float celestialAngle, final float partialTicks )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Vec3d getFogColor(final float par1, final float par2) {
|
||||
return new Vec3d(0.07, 0.07, 0.07);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getFogColor( final float par1, final float par2 )
|
||||
{
|
||||
return new Vec3d( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
@Override
|
||||
public boolean canRespawnHere() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRespawnHere()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isSkyColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public boolean isSkyColored()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean doesXZShowFog(final int par1, final int par2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesXZShowFog( final int par1, final int par2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public DimensionType getDimensionType() {
|
||||
return AppEng.instance().getStorageDimensionType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionType getDimensionType()
|
||||
{
|
||||
return AppEng.instance().getStorageDimensionType();
|
||||
}
|
||||
@Override
|
||||
public IRenderHandler getSkyRenderer() {
|
||||
return SpatialSkyRender.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRenderHandler getSkyRenderer()
|
||||
{
|
||||
return SpatialSkyRender.getInstance();
|
||||
}
|
||||
@Override
|
||||
public boolean isDaytime() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDaytime()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public Vec3d getSkyColor(final Entity cameraEntity, final float partialTicks) {
|
||||
return new Vec3d(0.07, 0.07, 0.07);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getSkyColor( final Entity cameraEntity, final float partialTicks )
|
||||
{
|
||||
return new Vec3d( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
@Override
|
||||
public float getStarBrightness(final float par1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStarBrightness( final float par1 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public boolean canSnowAt(final BlockPos pos, final boolean checkLight) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSnowAt( final BlockPos pos, final boolean checkLight )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public BlockPos getSpawnCoordinate() {
|
||||
return new BlockPos(0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getSpawnCoordinate()
|
||||
{
|
||||
return new BlockPos( 0, 0, 0 );
|
||||
}
|
||||
@Override
|
||||
public boolean isBlockHighHumidity(final BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockHighHumidity( final BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canDoLightning(final Chunk chunk) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDoLightning( final Chunk chunk )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome getBiomeForCoords( BlockPos pos )
|
||||
{
|
||||
return this.biome;
|
||||
}
|
||||
@Override
|
||||
public Biome getBiomeForCoords(BlockPos pos) {
|
||||
return this.biome;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user