9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

统一使用adaptor

This commit is contained in:
XiaoMoMi
2025-12-26 04:58:18 +08:00
parent 418446e3b2
commit 4420e4ceae
24 changed files with 79 additions and 39 deletions

View File

@@ -12,7 +12,7 @@ repositories {
dependencies {
// JOML
compileOnly("org.joml:joml:1.10.8")
compileOnly("org.joml:joml:${rootProject.properties["joml_version"]}")
// YAML
compileOnly(files("${rootProject.rootDir}/libs/boosted-yaml-${rootProject.properties["boosted_yaml_version"]}.jar"))
compileOnly("org.yaml:snakeyaml:${rootProject.properties["snake_yaml_version"]}")

View File

@@ -14,7 +14,6 @@ public class FurnitureHitBoxTypes {
public static final Key INTERACTION = Key.of("minecraft:interaction");
public static final Key SHULKER = Key.of("minecraft:shulker");
public static final Key HAPPY_GHAST = Key.of("minecraft:happy_ghast");
public static final Key VIRTUAL = Key.of("minecraft:virtual");
public static final Key CUSTOM = Key.of("minecraft:custom");
public static void register(Key key, FurnitureHitBoxConfigFactory<?> factory) {

View File

@@ -14,8 +14,8 @@ public final class RandomUtils {
return min + (max - min) * ThreadLocalRandom.current().nextFloat();
}
public static int generateRandomInt(int min, int max) {
return min >= max ? min : ThreadLocalRandom.current().nextInt(max - min) + min;
public static int generateRandomInt(int minInclusive, int maxExclusive) {
return minInclusive >= maxExclusive ? minInclusive : ThreadLocalRandom.current().nextInt(maxExclusive - minInclusive) + minInclusive;
}
public static boolean generateRandomBoolean() {

View File

@@ -19,6 +19,15 @@ public class WorldPosition implements Position {
this.yRot = 0f;
}
public WorldPosition(World world, Vec3i position) {
this.x = position.x();
this.y = position.y();
this.z = position.z();
this.world = world;
this.xRot = 0f;
this.yRot = 0f;
}
public WorldPosition(World world, Position position, float xRot, float yRot) {
this.x = position.x();
this.y = position.y();