| 1 | package net.minecraft.world.gen.layer;
|
| 2 |
|
| 3 | public class GenLayerAddIsland extends GenLayer
|
| 4 | {
|
| 5 | public GenLayerAddIsland(long p_i2119_1_, GenLayer p_i2119_3_)
|
| 6 | {
|
| 7 | super(p_i2119_1_);
|
| 8 | this.parent = p_i2119_3_;
|
| 9 | }
|
| 10 |
|
| 11 | /**
|
| 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
|
| 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass.
|
| 14 | */
|
| 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
|
| 16 | {
|
| 17 | int i = areaX - 1;
|
| 18 | int j = areaY - 1;
|
| 19 | int k = areaWidth + 2;
|
| 20 | int l = areaHeight + 2;
|
| 21 | int[] aint = this.parent.getInts(i, j, k, l);
|
| 22 | int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
|
| 23 |
|
| 24 | for (int i1 = 0; i1 < areaHeight; ++i1)
|
| 25 | {
|
| 26 | for (int j1 = 0; j1 < areaWidth; ++j1)
|
| 27 | {
|
| 28 | int k1 = aint[j1 + 0 + (i1 + 0) * k];
|
| 29 | int l1 = aint[j1 + 2 + (i1 + 0) * k];
|
| 30 | int i2 = aint[j1 + 0 + (i1 + 2) * k];
|
| 31 | int j2 = aint[j1 + 2 + (i1 + 2) * k];
|
| 32 | int k2 = aint[j1 + 1 + (i1 + 1) * k];
|
| 33 | this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));
|
| 34 |
|
| 35 | if (k2 != 0 || k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0)
|
| 36 | {
|
| 37 | if (k2 > 0 && (k1 == 0 || l1 == 0 || i2 == 0 || j2 == 0))
|
| 38 | {
|
| 39 | if (this.nextInt(5) == 0)
|
| 40 | {
|
| 41 | if (k2 == 4)
|
| 42 | {
|
| 43 | aint1[j1 + i1 * areaWidth] = 4;
|
| 44 | }
|
| 45 | else
|
| 46 | {
|
| 47 | aint1[j1 + i1 * areaWidth] = 0;
|
| 48 | }
|
| 49 | }
|
| 50 | else
|
| 51 | {
|
| 52 | aint1[j1 + i1 * areaWidth] = k2;
|
| 53 | }
|
| 54 | }
|
| 55 | else
|
| 56 | {
|
| 57 | aint1[j1 + i1 * areaWidth] = k2;
|
| 58 | }
|
| 59 | }
|
| 60 | else
|
| 61 | {
|
| 62 | int l2 = 1;
|
| 63 | int i3 = 1;
|
| 64 |
|
| 65 | if (k1 != 0 && this.nextInt(l2++) == 0)
|
| 66 | {
|
| 67 | i3 = k1;
|
| 68 | }
|
| 69 |
|
| 70 | if (l1 != 0 && this.nextInt(l2++) == 0)
|
| 71 | {
|
| 72 | i3 = l1;
|
| 73 | }
|
| 74 |
|
| 75 | if (i2 != 0 && this.nextInt(l2++) == 0)
|
| 76 | {
|
| 77 | i3 = i2;
|
| 78 | }
|
| 79 |
|
| 80 | if (j2 != 0 && this.nextInt(l2++) == 0)
|
| 81 | {
|
| 82 | i3 = j2;
|
| 83 | }
|
| 84 |
|
| 85 | if (this.nextInt(3) == 0)
|
| 86 | {
|
| 87 | aint1[j1 + i1 * areaWidth] = i3;
|
| 88 | }
|
| 89 | else if (i3 == 4)
|
| 90 | {
|
| 91 | aint1[j1 + i1 * areaWidth] = 4;
|
| 92 | }
|
| 93 | else
|
| 94 | {
|
| 95 | aint1[j1 + i1 * areaWidth] = 0;
|
| 96 | }
|
| 97 | }
|
| 98 | }
|
| 99 | }
|
| 100 |
|
| 101 | return aint1;
|
| 102 | }
|
| 103 | }
|
| 104 |
|