If a mod is present in this OptionalMod, returns the value, otherwise throws NoSuchElementException. @return the modobject held by this OptionalMod @throws NoSuchElementException if there is no modobject present @see Optional#isPresent()
()
| 73 | * @see Optional#isPresent() |
| 74 | */ |
| 75 | public T get() { |
| 76 | if (getValue() == null) { |
| 77 | throw new NoSuchElementException("No value present"); |
| 78 | } |
| 79 | return getValue(); |
| 80 | } |
| 81 | |
| 82 | public String getModId() { |
| 83 | return this.modId; |