mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
@@ -492,6 +492,10 @@ public abstract class AbstractFontManager implements FontManager {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (codepoints.length == 0) {
|
||||
TranslationManager.instance().log("warning.config.image.lack_char", path.toString(), id.toString());
|
||||
return;
|
||||
}
|
||||
codepointGrid[i] = codepoints;
|
||||
if (size == -1) size = codepoints.length;
|
||||
if (size != codepoints.length) {
|
||||
|
||||
@@ -101,6 +101,29 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
idList.forEach(this::writeVarInt);
|
||||
}
|
||||
|
||||
public List<byte[]> readByteArrayList() {
|
||||
int listSize = this.readVarInt();
|
||||
List<byte[]> bytes = new ArrayList<>();
|
||||
for (int i = 0; i < listSize; ++i) {
|
||||
bytes.add(this.readByteArray());
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public List<byte[]> readByteArrayList(int maxSize) {
|
||||
int listSize = this.readVarInt();
|
||||
List<byte[]> bytes = new ArrayList<>();
|
||||
for (int i = 0; i < listSize; ++i) {
|
||||
bytes.add(this.readByteArray(maxSize));
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public void writeByteArrayList(List<byte[]> bytes) {
|
||||
this.writeVarInt(bytes.size());
|
||||
bytes.forEach(this::writeByteArray);
|
||||
}
|
||||
|
||||
public <K, V, M extends Map<K, V>> M readMap(IntFunction<M> mapFactory, FriendlyByteBuf.Reader<K> keyReader, FriendlyByteBuf.Reader<V> valueReader) {
|
||||
int mapSize = this.readVarInt();
|
||||
M map = mapFactory.apply(mapSize);
|
||||
|
||||
Reference in New Issue
Block a user