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

Method getAllInBoxMutable

src/main/java/net/optifine/BlockPosM.java:161–216  ·  view source on GitHub ↗
(BlockPos from, BlockPos to)

Source from the content-addressed store, hash-verified

159 }
160
161 public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to)
162 {
163 final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
164 final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
165 return new Iterable()
166 {
167 public Iterator iterator()
168 {
169 return new AbstractIterator()
170 {
171 private BlockPosM theBlockPosM = null;
172 protected BlockPosM computeNext0()
173 {
174 if (this.theBlockPosM == null)
175 {
176 this.theBlockPosM = new BlockPosM(blockpos.getX(), blockpos.getY(), blockpos.getZ(), 3);
177 return this.theBlockPosM;
178 }
179 else if (this.theBlockPosM.equals(blockpos1))
180 {
181 return (BlockPosM)this.endOfData();
182 }
183 else
184 {
185 int i = this.theBlockPosM.getX();
186 int j = this.theBlockPosM.getY();
187 int k = this.theBlockPosM.getZ();
188
189 if (i < blockpos1.getX())
190 {
191 ++i;
192 }
193 else if (j < blockpos1.getY())
194 {
195 i = blockpos.getX();
196 ++j;
197 }
198 else if (k < blockpos1.getZ())
199 {
200 i = blockpos.getX();
201 j = blockpos.getY();
202 ++k;
203 }
204
205 this.theBlockPosM.setXyz(i, j, k);
206 return this.theBlockPosM;
207 }
208 }
209 protected Object computeNext()
210 {
211 return this.computeNext0();
212 }
213 };
214 }
215 };
216 }
217}

Callers 1

rebuildChunkMethod · 0.95

Calls 3

getXMethod · 0.65
getYMethod · 0.65
getZMethod · 0.65

Tested by

no test coverage detected