mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Basic impl for global palettes
This commit is contained in:
parent
3b38b69034
commit
600bf94044
@ -20,6 +20,7 @@ package com.volmit.iris.util.data.palette;
|
|||||||
|
|
||||||
import com.volmit.iris.util.nbt.tag.ListTag;
|
import com.volmit.iris.util.nbt.tag.ListTag;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
public class GlobalPalette<T> implements Palette<T> {
|
public class GlobalPalette<T> implements Palette<T> {
|
||||||
@ -27,6 +28,17 @@ public class GlobalPalette<T> implements Palette<T> {
|
|||||||
|
|
||||||
private final T defaultValue;
|
private final T defaultValue;
|
||||||
|
|
||||||
|
public GlobalPalette(T... f)
|
||||||
|
{
|
||||||
|
IdMapper<T> mapper = new IdMapper<>();
|
||||||
|
for(T i : f)
|
||||||
|
{
|
||||||
|
mapper.add(i);
|
||||||
|
}
|
||||||
|
registry = mapper;
|
||||||
|
defaultValue = f[0];
|
||||||
|
}
|
||||||
|
|
||||||
public GlobalPalette(IdMapper<T> var0, T var1) {
|
public GlobalPalette(IdMapper<T> var0, T var1) {
|
||||||
this.registry = var0;
|
this.registry = var0;
|
||||||
this.defaultValue = var1;
|
this.defaultValue = var1;
|
||||||
@ -50,6 +62,13 @@ public class GlobalPalette<T> implements Palette<T> {
|
|||||||
return this.registry.size();
|
return this.registry.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void read(ListTag var0) {
|
@Override
|
||||||
|
public void read(List<T> fromList) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(List<T> toList) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user