/** * @author jamierocks - 24th October 2016 * @reason To use custom ChunkProviders where necessary */ @Overwrite public IChunkProvider createChunkGenerator() { final IChunkProvider chunkProvider = this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings))); if (this.dimensionType.hasChunkProvider()) { final ChunkProviderCustom chunkProviderCustom = this.dimensionType.getChunkProvider(); chunkProviderCustom.setWorld((net.canarymod.api.world.World) this.worldObj); return new NeptuneChunkProviderCustom(chunkProviderCustom, chunkProvider); } else { return chunkProvider; } }
/** * Returns a new chunk provider which generates chunks for this world */ public IChunkProvider createChunkGenerator() { return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); }
public IBlockState getBlockState(final BlockPos pos) { if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD) { IBlockState iblockstate = null; if (pos.getY() == 60) { iblockstate = Blocks.barrier.getDefaultState(); } if (pos.getY() == 70) { iblockstate = ChunkProviderDebug.func_177461_b(pos.getX(), pos.getZ()); } return iblockstate == null ? Blocks.air.getDefaultState() : iblockstate; } else { try { if (pos.getY() >= 0 && pos.getY() >> 4 < this.storageArrays.length) { ExtendedBlockStorage extendedblockstorage = this.storageArrays[pos.getY() >> 4]; if (extendedblockstorage != null) { int j = pos.getX() & 15; int k = pos.getY() & 15; int i = pos.getZ() & 15; return extendedblockstorage.get(j, k, i); } } return Blocks.air.getDefaultState(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got"); crashreportcategory.addCrashSectionCallable("Location", new Callable<String>() { public String call() throws Exception { return CrashReportCategory.getCoordinateInfo(pos); } }); throw new ReportedException(crashreport); } } }
public IChunkGenerator createChunkGenerator() { return (IChunkGenerator)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderOverworld(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderOverworld(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); }
public IBlockState getBlockState(final int x, final int y, final int z) { if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD) { IBlockState iblockstate = null; if (y == 60) { iblockstate = Blocks.BARRIER.getDefaultState(); } if (y == 70) { iblockstate = ChunkProviderDebug.getBlockStateFor(x, z); } return iblockstate == null ? Blocks.AIR.getDefaultState() : iblockstate; } else { try { if (y >= 0 && y >> 4 < this.storageArrays.length) { ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4]; if (extendedblockstorage != NULL_BLOCK_STORAGE) { return extendedblockstorage.get(x & 15, y & 15, z & 15); } } return Blocks.AIR.getDefaultState(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got"); crashreportcategory.setDetail("Location", new ICrashReportDetail<String>() { public String call() throws Exception { return CrashReportCategory.getCoordinateInfo(x, y, z); } }); throw new ReportedException(crashreport); } } }