public void createTestIsland(Territory terr) { this.cRect = ChunkMap.getCenterDomain(terr); int islandId = this.terrToChunkMap(terr, IslandList.INVALID_ISLAND_ID, true); this.chunkMapToSquids(islandId); this.world.getIslandList().scanAdd(); }
public void createBountyIsland(Territory terr) { assert (terr.getXChunkCoord() == 0 && terr.getYChunkCoord() == 0); assert (this.world.getIslandList().getTotal() == 0); assert (this.player == null); this.cRect = ChunkMap.getCenterDomain(terr); int islandId = this.terrToChunkMap(terr, IslandList.INVALID_ISLAND_ID, true); this.chunkMapToSquids(islandId); this.world.getIslandList().scanAdd(); }
public static ChunkMap a(Chunk chunk, boolean flag, int i) { int j = 0; ChunkSection[] achunksection = chunk.i(); int k = 0; ChunkMap chunkmap = new ChunkMap(); byte[] abyte = buildBuffer; if (flag) { chunk.seenByPlayer = true; } int l; for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) { chunkmap.b |= 1 << l; if (achunksection[l].i() != null) { chunkmap.c |= 1 << l; ++k; } } } for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) { byte[] abyte1 = achunksection[l].g(); System.arraycopy(abyte1, 0, abyte, j, abyte1.length); j += abyte1.length; } } NibbleArray nibblearray; for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) { nibblearray = achunksection[l].j(); System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length); j += nibblearray.a.length; } } for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) { nibblearray = achunksection[l].k(); System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length); j += nibblearray.a.length; } } if (!chunk.world.worldProvider.f) { for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) { nibblearray = achunksection[l].l(); System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length); j += nibblearray.a.length; } } } if (k > 0) { for (l = 0; l < achunksection.length; ++l) { if (achunksection[l] != null && (!flag || !achunksection[l].a()) && achunksection[l].i() != null && (i & 1 << l) != 0) { nibblearray = achunksection[l].i(); System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length); j += nibblearray.a.length; } } } if (flag) { byte[] abyte2 = chunk.m(); System.arraycopy(abyte2, 0, abyte, j, abyte2.length); j += abyte2.length; } chunkmap.a = new byte[j]; System.arraycopy(abyte, 0, chunkmap.a, 0, j); return chunkmap; }