Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3public class NibbleArray {
4
5 public final byte[] a;
6
7 public NibbleArray(int i) {
8 this.a = new byte[i >> 1];
9 }
10
11 public NibbleArray(byte[] abyte) {
12 this.a = abyte;
13 }
14
15 public int a(int i, int j, int k) {
16 int l = i << 11 | k << 7 | j;
17 int i1 = l >> 1;
18 int j1 = l & 1;
19
20 return j1 == 0 ? this.a[i1] & 15 : this.a[i1] >> 4 & 15;
21 }
22
23 public void a(int i, int j, int k, int l) {
24 int i1 = i << 11 | k << 7 | j;
25 int j1 = i1 >> 1;
26 int k1 = i1 & 1;
27
28 if (k1 == 0) {
29 this.a[j1] = (byte) (this.a[j1] & 240 | l & 15);
30 } else {
31 this.a[j1] = (byte) (this.a[j1] & 15 | (l & 15) << 4);
32 }
33 }
34
35 public boolean a() {
36 return this.a != null;
37 }
38}