Skip to content

Commit

Permalink
forge 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pisaiah committed Jun 5, 2024
1 parent c60ac5d commit 0cd013d
Show file tree
Hide file tree
Showing 82 changed files with 2,230 additions and 323 deletions.
11 changes: 0 additions & 11 deletions Multiworld-Common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,3 @@ dependencies {
modImplementation(fabricApi.module(it, "0.86.1+1.19.4"))
}
}

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}
9 changes: 0 additions & 9 deletions Multiworld-Common/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
//import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.Difficulty;
//import net.minecraft.registry.RegistryKey;
import net.minecraft.world.World;

//import me.isaiah.lib.IText;

/**
* Multiworld Mod
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package me.isaiah.multiworld.command;

import java.util.ArrayList;
import java.util.Random;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Formatting;
Expand All @@ -18,8 +16,6 @@
import net.minecraft.server.world.ServerWorld;

import java.io.File;
import java.io.IOException;

import me.isaiah.multiworld.config.*;

public class CreateCommand {
Expand Down Expand Up @@ -192,25 +188,5 @@ public static void make_config(ServerWorld w, String dim, long seed) {
e.printStackTrace();
}
}

/**
*
*/
public static FileConfiguration get_config(World w) throws IOException {
File cf = new File(FabricLoader.getInstance().getConfigDir().toFile(), "multiworld");
cf.mkdirs();

File worlds = new File(cf, "worlds");
worlds.mkdirs();

Identifier id = w.getRegistryKey().getValue();
File namespace = new File(worlds, id.getNamespace());
namespace.mkdirs();

File wc = new File(namespace, id.getPath() + ".yml");
wc.createNewFile();
FileConfiguration config = new FileConfiguration(wc);
return config;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static int run(MinecraftServer mc, ServerPlayerEntity plr, String[] args)
MultiworldMod.get_world_creator().set_difficulty(w.getRegistryKey().getValue().toString(), d);

try {
FileConfiguration config = CreateCommand.get_config(w);
FileConfiguration config = Util.get_config(w);
config.set("difficulty", a1);
config.save();
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import java.util.HashMap;
import me.isaiah.multiworld.MultiworldMod;
import me.isaiah.multiworld.config.FileConfiguration;
import net.fabricmc.loader.api.FabricLoader;

import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.world.Difficulty;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraft.world.GameRules.BooleanRule;
Expand Down Expand Up @@ -121,7 +120,7 @@ public <T extends GameRules.Rule<T>> void visit(GameRules.Key<T> key, GameRules.
* @param b - The value for the Gamerule (ex: "true", or "100")
*/
public static void set_rule_cfg(World w, String a, String b) throws IOException {
File cf = new File(FabricLoader.getInstance().getConfigDir().toFile(), "multiworld");
File cf = new File(Util.get_platform_config_dir(), "multiworld");
cf.mkdirs();

File worlds = new File(cf, "worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.IOException;

import me.isaiah.multiworld.config.FileConfiguration;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Formatting;
Expand Down Expand Up @@ -34,7 +33,7 @@ public static int run(MinecraftServer mc, ServerPlayerEntity plr, String[] args)
}

public static void setSpawn(World w, BlockPos spawn) throws IOException {
File cf = new File(FabricLoader.getInstance().getConfigDir().toFile(), "multiworld");
File cf = new File(Util.get_platform_config_dir(), "multiworld");
cf.mkdirs();

File worlds = new File(cf, "worlds");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package me.isaiah.multiworld.command;

import java.io.File;
import java.io.IOException;

import me.isaiah.multiworld.MultiworldMod;
import me.isaiah.multiworld.config.FileConfiguration;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;

public class Util {

Expand All @@ -15,4 +20,29 @@ public static Identifier id(String id) {
return MultiworldMod.new_id(id);
}

public static File get_platform_config_dir() {
// return FabricLoader.getInstance().getConfigDir().toFile();
return new File("config");
}

/**
*
*/
public static FileConfiguration get_config(World w) throws IOException {
File cf = new File(get_platform_config_dir(), "multiworld");
cf.mkdirs();

File worlds = new File(cf, "worlds");
worlds.mkdirs();

Identifier id = w.getRegistryKey().getValue();
File namespace = new File(worlds, id.getNamespace());
namespace.mkdirs();

File wc = new File(namespace, id.getPath() + ".yml");
wc.createNewFile();
FileConfiguration config = new FileConfiguration(wc);
return config;
}

}
11 changes: 0 additions & 11 deletions Multiworld-Fabric-1.18.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,6 @@ sourceSets {

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

tasks.named("build") { finalizedBy("copyReport2") }
Expand Down
9 changes: 0 additions & 9 deletions Multiworld-Fabric-1.18.2/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
11 changes: 0 additions & 11 deletions Multiworld-Fabric-1.19.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@ tasks.withType<JavaCompile>().configureEach {

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

tasks.named("build") { finalizedBy("copyReport2") }
Expand Down
9 changes: 0 additions & 9 deletions Multiworld-Fabric-1.19.2/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
10 changes: 0 additions & 10 deletions Multiworld-Fabric-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ tasks.withType<JavaCompile>().configureEach {

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

Expand Down
9 changes: 0 additions & 9 deletions Multiworld-Fabric-1.19.4/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
11 changes: 0 additions & 11 deletions Multiworld-Fabric-1.20.1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@ tasks.withType<JavaCompile>().configureEach {

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

tasks.named("build") { finalizedBy("copyReport2") }
Expand Down
9 changes: 0 additions & 9 deletions Multiworld-Fabric-1.20.1/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
12 changes: 0 additions & 12 deletions Multiworld-Fabric-1.20.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ tasks.withType<JavaCompile>().configureEach {


tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

tasks.named("build") { finalizedBy("copyReport2") }
Expand Down
9 changes: 0 additions & 9 deletions Multiworld-Fabric-1.20.4/settings.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
11 changes: 0 additions & 11 deletions Multiworld-Fabric-1.20.6/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@ tasks.withType<JavaCompile>().configureEach {

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

tasks.getByName<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to "1.1"
)
)
}
}

val remapJar = tasks.getByName<RemapJarTask>("remapJar")

tasks.named("build") { finalizedBy("copyReport2") }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "multiworld",
"version": "1.8",
"version": "${version}",
"name": "Multiworld",
"description": "Travel between and manage multiple worlds.",
"authors": [
Expand Down
Loading

0 comments on commit 0cd013d

Please sign in to comment.