75 lines
1.6 KiB
Java
75 lines
1.6 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* org.apache.commons.lang3.Validate
|
|
*/
|
|
package net.minecraft.util;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.function.IntConsumer;
|
|
import net.minecraft.util.BitStorage;
|
|
import org.apache.commons.lang3.Validate;
|
|
|
|
public class ZeroBitStorage
|
|
implements BitStorage {
|
|
public static final long[] RAW = new long[0];
|
|
private final int size;
|
|
|
|
public ZeroBitStorage(int size) {
|
|
this.size = size;
|
|
}
|
|
|
|
@Override
|
|
public int getAndSet(int index, int value) {
|
|
Validate.inclusiveBetween((long)0L, (long)(this.size - 1), (long)index);
|
|
Validate.inclusiveBetween((long)0L, (long)0L, (long)value);
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public void set(int index, int value) {
|
|
Validate.inclusiveBetween((long)0L, (long)(this.size - 1), (long)index);
|
|
Validate.inclusiveBetween((long)0L, (long)0L, (long)value);
|
|
}
|
|
|
|
@Override
|
|
public int get(int index) {
|
|
Validate.inclusiveBetween((long)0L, (long)(this.size - 1), (long)index);
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public long[] getRaw() {
|
|
return RAW;
|
|
}
|
|
|
|
@Override
|
|
public int getSize() {
|
|
return this.size;
|
|
}
|
|
|
|
@Override
|
|
public int getBits() {
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public void getAll(IntConsumer output) {
|
|
for (int i = 0; i < this.size; ++i) {
|
|
output.accept(0);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void unpack(int[] output) {
|
|
Arrays.fill(output, 0, this.size, 0);
|
|
}
|
|
|
|
@Override
|
|
public BitStorage copy() {
|
|
return this;
|
|
}
|
|
}
|
|
|