Disable deprecated data generation API on NeoForge

This commit is contained in:
Juuz
2023-11-04 18:28:12 +02:00
parent 8feac3582f
commit 379312d8a2

View File

@@ -104,6 +104,10 @@ public class ForgeExtensionImpl implements ForgeExtensionAPI {
@Override
public List<String> getDataGenMods() {
if (extension.isNeoForge()) {
throw new UnsupportedOperationException("getDataGenMods is not available on NeoForge.");
}
// unmod list prevents uncontrolled additions (we want to create the run config too)
return Collections.unmodifiableList(dataGenMods);
}
@@ -111,6 +115,10 @@ public class ForgeExtensionImpl implements ForgeExtensionAPI {
@SuppressWarnings("Convert2Lambda")
@Override
public void dataGen(Action<DataGenConsumer> action) {
if (extension.isNeoForge()) {
throw new UnsupportedOperationException("dataGen is not available on NeoForge.");
}
action.execute(new DataGenConsumer() {
@Override
public void mod(String... modIds) {