MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getBlockState

Method getBlockState

src/main/java/net/minecraft/world/chunk/Chunk.java:586–637  ·  view source on GitHub ↗
(final BlockPos pos)

Source from the content-addressed store, hash-verified

584 }
585
586 public IBlockState getBlockState(final BlockPos pos)
587 {
588 if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD)
589 {
590 IBlockState iblockstate = null;
591
592 if (pos.getY() == 60)
593 {
594 iblockstate = Blocks.barrier.getDefaultState();
595 }
596
597 if (pos.getY() == 70)
598 {
599 iblockstate = ChunkProviderDebug.func_177461_b(pos.getX(), pos.getZ());
600 }
601
602 return iblockstate == null ? Blocks.air.getDefaultState() : iblockstate;
603 }
604 else
605 {
606 try
607 {
608 if (pos.getY() >= 0 && pos.getY() >> 4 < this.storageArrays.length)
609 {
610 ExtendedBlockStorage extendedblockstorage = this.storageArrays[pos.getY() >> 4];
611
612 if (extendedblockstorage != null)
613 {
614 int j = pos.getX() & 15;
615 int k = pos.getY() & 15;
616 int i = pos.getZ() & 15;
617 return extendedblockstorage.get(j, k, i);
618 }
619 }
620
621 return Blocks.air.getDefaultState();
622 }
623 catch (Throwable throwable)
624 {
625 CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state");
626 CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got");
627 crashreportcategory.addCrashSectionCallable("Location", new Callable<String>()
628 {
629 public String call() throws Exception
630 {
631 return CrashReportCategory.getCoordinateInfo(pos);
632 }
633 });
634 throw new ReportedException(crashreport);
635 }
636 }
637 }
638
639 /**
640 * Return the metadata corresponding to the given coordinates inside a chunk.

Callers 4

updateMapDataMethod · 0.95
getBlockStateMethod · 0.95
getBlockStateMethod · 0.95
setBlockStateMethod · 0.95

Calls 10

func_177461_bMethod · 0.95
getMethod · 0.95
makeCrashReportMethod · 0.95
makeCategoryMethod · 0.95
getDefaultStateMethod · 0.80
getWorldTypeMethod · 0.65
getYMethod · 0.65
getXMethod · 0.65
getZMethod · 0.65

Tested by

no test coverage detected