1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-04 15:43:00 +00:00

Update to latest Fabric

- Overhaul model loading to work with the new API. This allows for
   using the emissive texture system in a more generic way, which is
   nice!

 - Convert some of our custom models to use Fabric's model hooks (i.e.
   emitItemQuads). We don't make use of this right now, but might be
   useful for rendering tools with enchantment glints.

   Note this does /not/ change any of the turtle block entity rendering
   code to use Fabric/Forge's model code. This will be a change we want
   to make in the future.

 - Some cleanup of our config API. This fixes us printing lots of
   warnings when creating a new config file on Fabric (same bug also
   occurs on Forge, but that's a loader problem).

 - Fix a few warnings
This commit is contained in:
Jonathan Coates
2023-07-18 19:26:11 +01:00
parent c2988366d8
commit 24d74f5c80
28 changed files with 458 additions and 396 deletions

View File

@@ -32,7 +32,7 @@ public final class ForgeConfigFile implements ConfigFile {
@Override
public Stream<Entry> entries() {
return entries.children();
return entries.stream();
}
@Nullable
@@ -68,7 +68,7 @@ public final class ForgeConfigFile implements ConfigFile {
@Override
public void pop() {
var path = new ArrayList<>(groupStack);
entries.setValue(path, new GroupImpl(path, entries.getChild(path)));
entries.setValue(path, new GroupImpl(path));
builder.pop();
super.pop();
@@ -129,12 +129,10 @@ public final class ForgeConfigFile implements ConfigFile {
private static final class GroupImpl implements ConfigFile.Group {
private final List<String> path;
private final Trie<String, ConfigFile.Entry> entries;
private @Nullable ForgeConfigSpec owner;
private GroupImpl(List<String> path, Trie<String, ConfigFile.Entry> entries) {
private GroupImpl(List<String> path) {
this.path = path;
this.entries = entries;
}
@Override
@@ -148,11 +146,6 @@ public final class ForgeConfigFile implements ConfigFile {
if (owner == null) throw new IllegalStateException("Config has not been built yet");
return owner.getLevelComment(path);
}
@Override
public Stream<Entry> children() {
return entries.children();
}
}
private static final class ValueImpl<T> implements ConfigFile.Value<T> {