enable replacement of predefined types

This commit is contained in:
Frank Bauer 2021-07-30 14:49:14 +02:00
parent 2e624956aa
commit 37348ccb0e

View file

@ -250,6 +250,20 @@ public abstract class ComplexMaterial {
defaultBlockEntries.add(entry);
}
/**
* Replaces or Adds a default {@link BlockEntry} to this {@link ComplexMaterial}. Used to initiate blocks later.
* <p>
* If this {@link ComplexMaterial} does already contain an entry for the {@link ResourceLocation}, the entry will
* be removed first.
* @param entry {@link BlockEntry}
*/
protected void replaceOrAddBlockEntry(BlockEntry entry) {
int pos = defaultBlockEntries.indexOf(entry);
if (pos>=0) defaultBlockEntries.remove(entry);
addBlockEntry(entry);
}
/**
* Adds a default {@link ItemEntry} to this {@link ComplexMaterial}. Used to initiate items later.
* @param entry {@link ItemEntry}