Restructure into cross-platform monorepo: spi module, adapters tree, buildAll

This commit is contained in:
Brian Neumann-Fopiano
2026-06-12 02:41:06 -04:00
parent a1ff3b2c55
commit 7e224325f3
31 changed files with 585 additions and 6 deletions
+16
View File
@@ -0,0 +1,16 @@
plugins {
id 'java-library'
}
group = 'art.arcane'
version = rootProject.version
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
tasks.named('jar', Jar).configure {
archiveBaseName.set('iris-spi')
}
@@ -0,0 +1,32 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Hot-path chunk write surface backed by the fastest native section-write mechanism each adapter offers.
*/
public interface ChunkWriteTarget {
void setBlock(int x, int y, int z, PlatformBlockState state);
void setBiome(int x, int y, int z, PlatformBiome biome);
int minHeight();
int maxHeight();
}
@@ -0,0 +1,40 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
import java.io.File;
/**
* Root platform service provided by each adapter; the single entry point core uses to reach the host platform.
*/
public interface IrisPlatform {
String platformName();
String minecraftVersion();
PlatformRegistries registries();
PlatformScheduler scheduler();
PlatformCapabilities capabilities();
File dataFolder();
void log(LogLevel level, String message);
}
@@ -0,0 +1,29 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Severity levels for platform-routed log messages.
*/
public enum LogLevel {
DEBUG,
INFO,
WARN,
ERROR
}
@@ -0,0 +1,30 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Neutral handle for a resolved biome backed by an adapter-owned native handle.
*/
public interface PlatformBiome {
String key();
String namespace();
Object nativeHandle();
}
@@ -0,0 +1,38 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Neutral handle for a resolved block state; the canonical key is the config currency and the native handle is adapter-owned.
*/
public interface PlatformBlockState {
String key();
String namespace();
boolean isAir();
boolean isSolid();
boolean hasTileEntity();
PlatformBlockState withProperty(String name, String value);
Object nativeHandle();
}
@@ -0,0 +1,40 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Capability flags describing which optional platform features an adapter supports; all default to unsupported.
*/
public interface PlatformCapabilities {
default boolean customBiomes() {
return false;
}
default boolean dataPacks() {
return false;
}
default boolean structurePlacement() {
return false;
}
default boolean regionizedThreading() {
return false;
}
}
@@ -0,0 +1,30 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Neutral handle for a resolved entity type backed by an adapter-owned native handle.
*/
public interface PlatformEntityType {
String key();
String namespace();
Object nativeHandle();
}
@@ -0,0 +1,30 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Neutral handle for a resolved item type backed by an adapter-owned native handle.
*/
public interface PlatformItem {
String key();
String namespace();
Object nativeHandle();
}
@@ -0,0 +1,40 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
import java.util.List;
/**
* Resolves namespaced string keys against the platform's live registries into interned neutral handles.
*/
public interface PlatformRegistries {
PlatformBlockState block(String key);
PlatformBiome biome(String key);
PlatformItem item(String key);
PlatformEntityType entity(String key);
List<String> blockKeys();
List<String> biomeKeys();
List<String> structureKeys();
}
@@ -0,0 +1,34 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Platform task dispatch; region scheduling targets the owning region thread on regionized platforms and the global thread elsewhere.
*/
public interface PlatformScheduler {
void global(Runnable task);
void region(PlatformWorld world, int chunkX, int chunkZ, Runnable task);
void async(Runnable task);
void laterGlobal(Runnable task, int ticks);
void laterRegion(PlatformWorld world, int chunkX, int chunkZ, Runnable task, int ticks);
}
@@ -0,0 +1,42 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.spi;
/**
* Neutral view of a loaded world for edit and lifecycle paths; never used on the generation hot path.
*/
public interface PlatformWorld {
String name();
long seed();
int minHeight();
int maxHeight();
PlatformBlockState getBlock(int x, int y, int z);
void setBlock(int x, int y, int z, PlatformBlockState block, int flags);
PlatformBiome getBiome(int x, int y, int z);
boolean isChunkLoaded(int chunkX, int chunkZ);
Object nativeHandle();
}