Offset this BlockPos 1 block in the given direction
(EnumFacing facing)
| 93 | * Offset this BlockPos 1 block in the given direction |
| 94 | */ |
| 95 | public BlockPos offset(EnumFacing facing) |
| 96 | { |
| 97 | if (this.level <= 0) |
| 98 | { |
| 99 | return super.offset(facing, 1); |
| 100 | } |
| 101 | else |
| 102 | { |
| 103 | if (this.facings == null) |
| 104 | { |
| 105 | this.facings = new BlockPosM[EnumFacing.VALUES.length]; |
| 106 | } |
| 107 | |
| 108 | if (this.needsUpdate) |
| 109 | { |
| 110 | this.update(); |
| 111 | } |
| 112 | |
| 113 | int i = facing.getIndex(); |
| 114 | BlockPosM blockposm = this.facings[i]; |
| 115 | |
| 116 | if (blockposm == null) |
| 117 | { |
| 118 | int j = this.mx + facing.getFrontOffsetX(); |
| 119 | int k = this.my + facing.getFrontOffsetY(); |
| 120 | int l = this.mz + facing.getFrontOffsetZ(); |
| 121 | blockposm = new BlockPosM(j, k, l, this.level - 1); |
| 122 | this.facings[i] = blockposm; |
| 123 | } |
| 124 | |
| 125 | return blockposm; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Offsets this BlockPos n blocks in the given direction |
no test coverage detected