Skip to content

Commit af0d633

Browse files
ThisIsBrady073TheBossleMaik
authored
Reimplement the Materials tab (#609)
* Implement Materials Tab * Optimize Materials Tab Materials are no longer reloaded before each frame in preview * Remove comment * Clean up block list * Fix memory leak * Code improvements from reviews * Add blocks to the MaterialStore after the provider is registered. * Make the material properties non-global so that they reset automatically when creating/loading a new scene. * Fix default material properties being reset when starting the renderer. Co-authored-by: 073TheBoss <073throwaway@gmail.com> Co-authored-by: Maik Marschner <an@maik.tk>
1 parent 466c56b commit af0d633

10 files changed

Lines changed: 904 additions & 69 deletions

File tree

chunky/src/java/se/llbit/chunky/block/BlockProvider.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
import se.llbit.nbt.StringTag;
44
import se.llbit.nbt.Tag;
55

6+
import java.util.Collection;
7+
68
public interface BlockProvider {
79
Block getBlockByTag(String name, Tag tag);
810

11+
/**
12+
*
13+
* @return A collection of block IDs that this provider provides.
14+
*/
15+
Collection<String> getSupportedBlocks();
16+
917
static String facing(Tag tag, String defaultValue) {
1018
return tag.get("Properties").get("facing").stringValue(defaultValue);
1119
}

chunky/src/java/se/llbit/chunky/block/BlockSpec.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
public class BlockSpec {
1313
public static final List<BlockProvider> blockProviders = new LinkedList<>();
1414

15-
static {
16-
blockProviders.add(new MinecraftBlockProvider());
17-
}
18-
1915
private final Tag tag;
2016

2117
public BlockSpec(@NotNull Tag tag) {

0 commit comments

Comments
 (0)