mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-01 15:37:24 +00:00
Merge branch 'master' into dev/1.21.6
This commit is contained in:
commit
bd253ea5d2
8
.github/workflows/gradle-build.yml
vendored
8
.github/workflows/gradle-build.yml
vendored
@ -17,16 +17,16 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
- uses: actions/checkout@v4.2.2
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
|
uses: actions/setup-java@v4.7.1
|
||||||
with:
|
with:
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||||
|
|
||||||
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
|
- uses: burrunan/gradle-cache-action@v3.0.1
|
||||||
name: Build Terra
|
name: Build Terra
|
||||||
with:
|
with:
|
||||||
# Specifies arguments for Gradle execution
|
# Specifies arguments for Gradle execution
|
||||||
@ -44,4 +44,4 @@ jobs:
|
|||||||
# Properties are passed as -Pname=value
|
# Properties are passed as -Pname=value
|
||||||
properties: |
|
properties: |
|
||||||
kotlin.js.compiler=ir
|
kotlin.js.compiler=ir
|
||||||
kotlin.parallel.tasks.in.project=true
|
kotlin.parallel.tasks.in.project=true
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
preRelease(true)
|
preRelease(true)
|
||||||
|
|
||||||
versionProjects(":common:api", version("6.6.1"))
|
versionProjects(":common:api", version("6.6.3"))
|
||||||
versionProjects(":common:implementation", version("6.6.1"))
|
versionProjects(":common:implementation", version("6.6.3"))
|
||||||
versionProjects(":platforms", version("6.6.1"))
|
versionProjects(":platforms", version("6.6.3"))
|
||||||
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
@ -31,6 +31,8 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.UncheckedIOException;
|
import java.io.UncheckedIOException;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -327,6 +329,28 @@ public abstract class AbstractPlatform implements Platform {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String moonrise = "Moonrise";
|
||||||
|
public static int getMoonriseGenerationThreadsWithReflection() {
|
||||||
|
try {
|
||||||
|
Class<?> prioritisedThreadPoolClazz = Class.forName("ca.spottedleaf.concurrentutil.executor.thread.PrioritisedThreadPool");
|
||||||
|
Method getCoreThreadsMethod = prioritisedThreadPoolClazz.getDeclaredMethod("getCoreThreads");
|
||||||
|
getCoreThreadsMethod.setAccessible(true);
|
||||||
|
Class<?> moonriseCommonClazz = Class.forName("ca.spottedleaf.moonrise.common.util.MoonriseCommon");
|
||||||
|
Object pool = moonriseCommonClazz.getDeclaredField("WORKER_POOL").get(null);
|
||||||
|
int threads = ((Thread[]) getCoreThreadsMethod.invoke(pool)).length;
|
||||||
|
logger.info("{} found, setting {} generation threads.", moonrise, threads);
|
||||||
|
return threads;
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
logger.info("{} not found.", moonrise);
|
||||||
|
} catch (NoSuchMethodException | NoSuchFieldException e) {
|
||||||
|
logger.warn("{} found, but field/method not found this probably means {0} has changed its code and " +
|
||||||
|
"Terra has not updated to reflect that.", moonrise);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
logger.error("Failed to access thread values in {}, assuming 1 generation thread.", moonrise, e);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register(TypeRegistry registry) {
|
public void register(TypeRegistry registry) {
|
||||||
|
@ -55,7 +55,7 @@ public class ConfigRegistry extends OpenRegistryImpl<ConfigPack> {
|
|||||||
for(File dir : Objects.requireNonNull(packsFolder.listFiles(File::isDirectory))) {
|
for(File dir : Objects.requireNonNull(packsFolder.listFiles(File::isDirectory))) {
|
||||||
try {
|
try {
|
||||||
load(dir, platform);
|
load(dir, platform);
|
||||||
} catch(ConfigException e) {
|
} catch(RuntimeException e) {
|
||||||
logger.error("Error loading config pack {}", dir.getName(), e);
|
logger.error("Error loading config pack {}", dir.getName(), e);
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ public class ConfigRegistry extends OpenRegistryImpl<ConfigPack> {
|
|||||||
try {
|
try {
|
||||||
logger.info("Loading ZIP archive: {}", zip.getName());
|
logger.info("Loading ZIP archive: {}", zip.getName());
|
||||||
load(new ZipFile(zip), platform);
|
load(new ZipFile(zip), platform);
|
||||||
} catch(IOException | ConfigException e) {
|
} catch(IOException | RuntimeException e) {
|
||||||
logger.error("Error loading config pack {}", zip.getName(), e);
|
logger.error("Error loading config pack {}", zip.getName(), e);
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class PlatformImpl extends AbstractPlatform {
|
|||||||
private int generationThreads;
|
private int generationThreads;
|
||||||
|
|
||||||
public PlatformImpl(TerraBukkitPlugin plugin) {
|
public PlatformImpl(TerraBukkitPlugin plugin) {
|
||||||
generationThreads = getGenerationThreadsWithReflection("ca.spottedleaf.moonrise.common.util.MoonriseCommon", "WORKER_THREADS", "Moonrise");
|
generationThreads = getMoonriseGenerationThreadsWithReflection();
|
||||||
if (generationThreads == 0) {
|
if (generationThreads == 0) {
|
||||||
generationThreads = 1;
|
generationThreads = 1;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.16.10",
|
"fabricloader": ">=0.16.10",
|
||||||
"java": ">=21",
|
"java": ">=21",
|
||||||
"minecraft": ">=1.21.4",
|
"minecraft": ">=1.21.5",
|
||||||
"fabric": "*"
|
"fabric": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:snowy_taiga"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:old_growth_pine_taiga"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:old_growth_spruce_taiga"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:taiga"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:is_jungle"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:grove"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:is_savanna"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:is_badlands"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:forest"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_ashen_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_ashen_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_ashen"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/ashen"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_black_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_black_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_black"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/black"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_chestnut_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_chestnut_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_chestnut"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/chestnut"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/pale"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_rusty_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_rusty_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_rusty"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/rusty"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_snowy_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_snowy_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_snowy"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/snowy"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_spotted_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_spotted_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_spotted"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/spotted"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_striped_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_striped_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_striped"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/striped"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"assets": {
|
||||||
|
"angry": "minecraft:entity/wolf/wolf_woods_angry",
|
||||||
|
"tame": "minecraft:entity/wolf/wolf_woods_tame",
|
||||||
|
"wild": "minecraft:entity/wolf/wolf_woods"
|
||||||
|
},
|
||||||
|
"spawn_conditions": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"type": "minecraft:biome",
|
||||||
|
"biomes": "#c:has_wolf_variant/woods"
|
||||||
|
},
|
||||||
|
"priority": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -45,7 +45,7 @@ public abstract class LifecyclePlatform extends ModPlatform {
|
|||||||
public LifecyclePlatform() {
|
public LifecyclePlatform() {
|
||||||
generationThreads = getGenerationThreadsWithReflection("com.ishland.c2me.base.common.GlobalExecutors", "GLOBAL_EXECUTOR_PARALLELISM", "C2ME");
|
generationThreads = getGenerationThreadsWithReflection("com.ishland.c2me.base.common.GlobalExecutors", "GLOBAL_EXECUTOR_PARALLELISM", "C2ME");
|
||||||
if (generationThreads == 0) {
|
if (generationThreads == 0) {
|
||||||
generationThreads = getGenerationThreadsWithReflection("ca.spottedleaf.moonrise.common.util.MoonriseCommon", "WORKER_THREADS", "Moonrise");
|
generationThreads = getMoonriseGenerationThreadsWithReflection();
|
||||||
} if (generationThreads == 0) {
|
} if (generationThreads == 0) {
|
||||||
generationThreads = 1;
|
generationThreads = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user