Skip to content

Commit

Permalink
1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pisaiah committed May 30, 2024
1 parent e2d3af1 commit 9630153
Show file tree
Hide file tree
Showing 52 changed files with 754 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Multiworld-Common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

id ("java-library")
id ("maven-publish")
id ("dev.architectury.loom") version "1.4-SNAPSHOT"
id ("dev.architectury.loom") version "1.6-SNAPSHOT"
id ("architectury-plugin") version "3.4-SNAPSHOT"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public default Text colored_literal(String txt, Formatting color) {
}
}

public BlockPos get_spawn(ServerWorld world);

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public static BlockPos getSpawn(ServerWorld w) {
// getSpawnPos
public static BlockPos multiworld_method_43126(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
BlockPos pos = new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());

BlockPos pos = MultiworldMod.get_world_creator().get_spawn(world);
// BlockPos pos = new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());

if (!world.getWorldBorder().contains(pos)) {
BlockPos pp = MultiworldMod.get_world_creator().get_pos(world.getWorldBorder().getCenterX(), 0.0, world.getWorldBorder().getCenterZ());
pos = world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, new BlockPos(pp));
Expand Down
2 changes: 1 addition & 1 deletion Multiworld-Fabric-1.18.2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("fabric-loom") version "1.6-SNAPSHOT"
id ("maven-publish")
id ("java-library")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.Difficulty;
import net.minecraft.world.WorldProperties;
import net.minecraft.server.world.ServerWorld;

import xyz.nucleoid.fantasy.Fantasy;
Expand Down Expand Up @@ -73,4 +74,10 @@ public BlockPos get_pos(double x, double y, double z) {
return new BlockPos(x, y, z);
}

@Override
public BlockPos get_spawn(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
return new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());
}

}
17 changes: 16 additions & 1 deletion Multiworld-Fabric-1.19.2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("fabric-loom") version "1.6-SNAPSHOT"
id ("maven-publish")
id ("java-library")
}
Expand All @@ -20,6 +20,9 @@ base {

dependencies {

annotationProcessor("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")
compileOnly("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")

// 1.19.2
minecraft("com.mojang:minecraft:1.19.2")
mappings("net.fabricmc:yarn:1.19.2+build.28:v2")
Expand Down Expand Up @@ -60,6 +63,18 @@ sourceSets {
}
}

// Jabel
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString() // for the IDE support
options.release.set(8)

javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}

/*configure([tasks.compileJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.world.dimension.DimensionTypes;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.Difficulty;
import net.minecraft.world.WorldProperties;
import net.minecraft.server.world.ServerWorld;

import xyz.nucleoid.fantasy.Fantasy;
Expand Down Expand Up @@ -68,5 +69,11 @@ public boolean is_the_end(ServerWorld world) {
public BlockPos get_pos(double x, double y, double z) {
return new BlockPos(x, y, z);
}

@Override
public BlockPos get_spawn(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
return new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());
}

}
18 changes: 17 additions & 1 deletion Multiworld-Fabric-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("fabric-loom") version "1.6-SNAPSHOT"
id ("maven-publish")
id ("java-library")
}
Expand All @@ -18,6 +18,10 @@ base {
}

dependencies {

annotationProcessor("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")
compileOnly("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")

// 1.19.4
minecraft("com.mojang:minecraft:1.19.4")
mappings("net.fabricmc:yarn:1.19.4+build.1:v2")
Expand Down Expand Up @@ -58,6 +62,18 @@ sourceSets {
}
}

// Jabel
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString() // for the IDE support
options.release.set(8)

javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}

/*configure([tasks.compileJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Difficulty;
import net.minecraft.world.WorldProperties;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.dimension.DimensionTypes;
import net.minecraft.world.gen.chunk.ChunkGenerator;
Expand Down Expand Up @@ -66,5 +67,11 @@ public boolean is_the_end(ServerWorld world) {
public BlockPos get_pos(double x, double y, double z) {
return BlockPos.ofFloored(x, y, z);
}

@Override
public BlockPos get_spawn(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
return new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());
}

}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("fabric-loom") version "1.6-SNAPSHOT"
id ("maven-publish")
id ("java-library")
}
Expand All @@ -13,21 +13,24 @@ java {

base {
archivesBaseName = "Multiworld-Fabric"
version = "1.20"
version = "1.20.1"
group = "me.isaiah.mods"
}

dependencies {

annotationProcessor("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")
compileOnly("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")

// 1.19.2
//minecraft("com.mojang:minecraft:1.19.2")
//mappings("net.fabricmc:yarn:1.19.2+build.28:v2")
//modImplementation("net.fabricmc:fabric-loader:0.14.9")

// 1.20
minecraft("com.mojang:minecraft:1.20")
mappings("net.fabricmc:yarn:1.20+build.1:v2")
modImplementation("net.fabricmc:fabric-loader:0.14.21")
minecraft("com.mojang:minecraft:1.20.1")
mappings("net.fabricmc:yarn:1.20.1+build.10")
modImplementation("net.fabricmc:fabric-loader:0.15.11")

include("xyz.nucleoid:fantasy:0.4.11+1.20-rc1")
modImplementation("xyz.nucleoid:fantasy:0.4.11+1.20-rc1")
Expand Down Expand Up @@ -64,6 +67,18 @@ sourceSets {
}
}

// Jabel
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString() // for the IDE support
options.release.set(8)

javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}

/*configure([tasks.compileJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package me.isaiah.multiworld.fabric;

import me.isaiah.multiworld.ICreator;
import me.isaiah.multiworld.MultiworldMod;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Difficulty;
import net.minecraft.world.WorldProperties;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.dimension.DimensionTypes;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import xyz.nucleoid.fantasy.Fantasy;
import xyz.nucleoid.fantasy.RuntimeWorldConfig;
import xyz.nucleoid.fantasy.RuntimeWorldHandle;

public class FabricWorldCreator implements ICreator {

public static void init() {
MultiworldMod.setICreator(new FabricWorldCreator());
}

public ServerWorld create_world(String id, Identifier dim, ChunkGenerator gen, Difficulty dif, long seed) {
RuntimeWorldConfig config = new RuntimeWorldConfig()
.setDimensionType(dim_of(dim))
.setGenerator(gen)
.setDifficulty(Difficulty.NORMAL)
.setSeed(seed)
.setShouldTickTime(true)
;

Fantasy fantasy = Fantasy.get(MultiworldMod.mc);
RuntimeWorldHandle worldHandle = fantasy.getOrOpenPersistentWorld(new Identifier(id), config);
return worldHandle.asWorld();
}

private static RegistryKey<DimensionType> dim_of(Identifier id) {
return RegistryKey.of(RegistryKeys.DIMENSION_TYPE, id);
}

public void delete_world(String id) {
Fantasy fantasy = Fantasy.get(MultiworldMod.mc);
RuntimeWorldHandle worldHandle = fantasy.getOrOpenPersistentWorld(new Identifier(id), null);
worldHandle.delete();
}

@Override
public Text colored_literal(String txt, Formatting color) {
try {
return Text.of(txt).copy().formatted(color);
} catch (Exception | IncompatibleClassChangeError e) {
// Fallback
return Text.of(txt);
}
}

@Override
public boolean is_the_end(ServerWorld world) {
return world.getDimensionKey() == DimensionTypes.THE_END;
}

@Override
public BlockPos get_pos(double x, double y, double z) {
return BlockPos.ofFloored(x, y, z);
}

@Override
public BlockPos get_spawn(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
return new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());
}

}
17 changes: 16 additions & 1 deletion Multiworld-Fabric-1.20.4/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("fabric-loom") version "1.6-SNAPSHOT"
id ("maven-publish")
id ("java-library")
}
Expand All @@ -19,6 +19,9 @@ base {

dependencies {

annotationProcessor("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")
compileOnly("com.pkware.jabel:jabel-javac-plugin:1.0.1-1")

// 1.20.4
minecraft("com.mojang:minecraft:1.20.4")
mappings("net.fabricmc:yarn:1.20.4+build.3:v2")
Expand Down Expand Up @@ -60,6 +63,18 @@ sourceSets {
}
}

// Jabel
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString() // for the IDE support
options.release.set(8)

javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}

/*configure([tasks.compileJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Difficulty;
import net.minecraft.world.WorldProperties;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.dimension.DimensionTypes;
import net.minecraft.world.gen.chunk.ChunkGenerator;
Expand Down Expand Up @@ -66,5 +67,11 @@ public boolean is_the_end(ServerWorld world) {
public BlockPos get_pos(double x, double y, double z) {
return BlockPos.ofFloored(x, y, z);
}

@Override
public BlockPos get_spawn(ServerWorld world) {
WorldProperties prop = world.getLevelProperties();
return new BlockPos(prop.getSpawnX(), prop.getSpawnY(), prop.getSpawnZ());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"depends": {
"fabric": "*",
"minecraft": ">=1.20.3"
"minecraft": ">=1.20.3- <1.20.5-"
},
"mixins": [
"dim.mixins.json"
Expand Down
Loading

0 comments on commit 9630153

Please sign in to comment.