mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-10-25 20:32:24 +00:00
Add a debug check to sniff out errors like typos
This commit is contained in:
1 parent
a069612e04
commit
4982bb780d
2 files changed
+7
-1
No files matched your search
@@ -13,8 +13,11 @@ public interface IStructureDefinition<T> {
|
||||
/**
|
||||
* Used internally
|
||||
*
|
||||
* Might, but is not required, to throw {@link java.util.NoSuchElementException} if the given structure piece is not found.
|
||||
*
|
||||
* @param name same name as for other methods here
|
||||
* @return the array of elements to process
|
||||
* @throws java.util.NoSuchElementException if the given structure piece is not found and the moon phase perfectly matches
|
||||
*/
|
||||
IStructureElement<T>[] getStructureFor(String name);
|
||||
|
||||
|
||||
@@ -193,6 +193,9 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
|
||||
|
||||
@Override
|
||||
public IStructureElement<T>[] getStructureFor(String name) {
|
||||
return structures.get(name);
|
||||
IStructureElement<T>[] elements = structures.get(name);
|
||||
if (elements == null)
|
||||
throw new NoSuchElementException(name);
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user