Skip to content

Commit

Permalink
Custom Void Dimension, Replace JED's
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Jul 6, 2024
1 parent b231e9e commit 0558a3d
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 8 deletions.
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1719793363
//version: 1720106721
/*
* DO NOT CHANGE THIS FILE!
* Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -33,9 +33,9 @@ plugins {
id 'base'
id 'eclipse'
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33'
id 'net.darkhax.curseforgegradle' version '1.1.18' apply false
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8'
id 'com.gtnewhorizons.retrofuturagradle' version '1.4.0'
id 'net.darkhax.curseforgegradle' version '1.1.24' apply false
id 'com.modrinth.minotaur' version '2.8.7' apply false
id 'com.diffplug.spotless' version '6.13.0' apply false
id 'com.palantir.git-version' version '3.0.0' apply false
Expand Down Expand Up @@ -78,8 +78,10 @@ propertyDefaultIfUnset("gradleTokenVersion", "")
propertyDefaultIfUnset("useSrcApiPath", false)
propertyDefaultIfUnset("includeWellKnownRepositories", true)
propertyDefaultIfUnset("includeCommonDevEnvMods", true)
propertyDefaultIfUnset("stripForgeRequirements", false)
propertyDefaultIfUnset("noPublishedSources", false)
propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("mixinConfigRefmap", "mixins.${project.modId}.refmap.json")
propertyDefaultIfUnsetWithEnvVar("enableCoreModDebug", false, "CORE_MOD_DEBUG")
propertyDefaultIfUnset("generateMixinConfig", true)
propertyDefaultIfUnset("usesShadowedDependencies", false)
Expand Down Expand Up @@ -525,7 +527,7 @@ dependencies {
// should use 2.8.6 but 2.8.9+ has a vulnerability fix
annotationProcessor 'com.google.code.gson:gson:2.8.9'

mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, "mixins.${modId}.refmap.json")
mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, mixinConfigRefmap)
api (mixinProviderSpec) {
transitive = false
}
Expand Down Expand Up @@ -567,6 +569,10 @@ dependencies {
transitive = false
}

if ((usesMixins.toBoolean() || forceEnableMixins.toBoolean()) && stripForgeRequirements.toBoolean()) {
runtimeOnlyNonPublishable 'com.cleanroommc:strip-latest-forge-requirements:1.0'
}

if (includeCommonDevEnvMods.toBoolean()) {
if (!(modId.equals('jei'))) {
implementation 'mezz.jei:jei_1.12.2:4.16.1.302'
Expand Down Expand Up @@ -700,7 +706,6 @@ tasks.register('generateAssets') {
if (usesMixins.toBoolean() && generateMixinConfig.toBoolean()) {
def mixinConfigFile = getFile("src/main/resources/mixins.${modId}.json")
if (!mixinConfigFile.exists()) {
def mixinConfigRefmap = "mixins.${modId}.refmap.json"

mixinConfigFile.text = """{
"package": "${modGroup}.${mixinsPackage}",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ enable_controlling = false
# Whether to enable Default World Generator Port in runtime. Fixes GUI Rescaling Issues, adds a Cancel Button.
enable_default_world_gen_port = false

# Whether to enable TOP Addons in runtime. Fixes Error Messages with Architecture Craft 3.108
# Whether to enable TOP Addons in runtime. Fixes Error Messages with Architecture Craft 3.108.
enable_top_addons = false

# Whether to enable Ender Storage in runtime. Enables remappers to remap items in ender storage.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/nomiceu/nomilabs/NomiLabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
name = LabsValues.LABS_MODNAME,
acceptedMinecraftVersions = "[1.12.2]",
dependencies = "required:forge@[14.23.5.2847,);" + "required-after:codechickenlib@[3.2.3,);" +
"required-after:groovyscript@[1.1.0,);" + "required-after:gregtech@[2.8,);" + "required-after:packmode;" +
"required-after:groovyscript@[1.1.0,);" + "required-after:gregtech@[2.8,);" + "required-after:gcym;" +
"required-after:packmode;" +
"required-after:jei@[4.15.0,);" + "required-after:theoneprobe;" + "required-after:configanytime;" +
"after:advancedrocketry;" +
"after:libvulpes;" + "after:crafttweaker@[4.1.20,);" + "after:appliedenergistics2;" +
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ public static class CustomContent {
@Config.LangKey("config.nomilabs.content.custom_content.complex_recipes")
@Config.RequiresMcRestart
public boolean enableComplexRecipes = true;

@Config.Comment({
"Enable a Custom Void Dimension.",
"By default, has no blocks, and there is no way to reach it.",
"DimensionalEdibles (Nomifactory Edition) can allow transport to it, as well as provide a spawn obsidian platform.",
"[default: false]"
})
@Config.LangKey("config.nomilabs.content.custom_content.custom_void")
@Config.RequiresMcRestart
public boolean enableVoidDimension = false;
}

public static class GTCustomContent {
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/nomiceu/nomilabs/dimension/LabsDimensions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.nomiceu.nomilabs.dimension;

import net.minecraft.world.DimensionType;
import net.minecraftforge.common.DimensionManager;

public class LabsDimensions {

public static final int VOID_ID = 119;

public static DimensionType VOID;

public static void register() {
VOID = DimensionType.register("void_world", "_void", VOID_ID, LabsVoidWorldProvider.class, false);
DimensionManager.registerDimension(VOID_ID, VOID);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.nomiceu.nomilabs.dimension;

import net.minecraft.util.math.BlockPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.gen.ChunkGeneratorFlat;
import net.minecraft.world.gen.IChunkGenerator;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class LabsVoidWorldProvider extends WorldProvider {

private static final BlockPos spawnPos = new BlockPos(2.5, 80, 2.5);

@Override
@NotNull
public DimensionType getDimensionType() {
return LabsDimensions.VOID;
}

@Override
@NotNull
public IChunkGenerator createChunkGenerator() {
return new ChunkGeneratorFlat(world, getSeed(), false, "3;minecraft:air;1;decoration");
}

@Override
@NotNull
public BlockPos getRandomizedSpawnPoint() {
return spawnPos;
}

@Override
@NotNull
public BlockPos getSpawnPoint() {
return spawnPos;
}

@Override
@Nullable
public BlockPos getSpawnCoordinate() {
return spawnPos;
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.nomiceu.nomilabs.block.registry.LabsBlocks;
import com.nomiceu.nomilabs.config.LabsConfig;
import com.nomiceu.nomilabs.creativetab.registry.LabsCreativeTabs;
import com.nomiceu.nomilabs.dimension.LabsDimensions;
import com.nomiceu.nomilabs.fluid.FluidRegistryMixinHelper;
import com.nomiceu.nomilabs.fluid.registry.LabsFluids;
import com.nomiceu.nomilabs.gregtech.LabsSounds;
Expand Down Expand Up @@ -93,6 +94,9 @@ public static void preInit() {
FluidRegistryMixinHelper.preInit();

LabsNetworkHandler.preInit();

if (LabsConfig.content.customContent.enableVoidDimension)
LabsDimensions.register();
}

public static void loadComplete() {
Expand Down

0 comments on commit 0558a3d

Please sign in to comment.