enable replacement of predefined types
This commit is contained in:
parent
2e624956aa
commit
37348ccb0e
1 changed files with 14 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue