Skip to content

Commit

Permalink
made a separate resource location for otherside dimension effects
Browse files Browse the repository at this point in the history
fixes #386
  • Loading branch information
NewJumper committed Nov 6, 2024
1 parent 84b7028 commit 17e212a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 1.21 2024-08-16T00:14:23.9239195 Registries
// 1.21 2024-11-06T14:48:57.830265 Registries
65c8c67a4ec7ef0ce6846fb2f4d921cc6ceb02e2 data/deeperdarker/damage_type/bite.json
0b65c61bd1e5086d0f3685566cc6cecf6e324516 data/deeperdarker/damage_type/ring.json
dede162345c14db637f3dd9a20ca9319e037ae9d data/deeperdarker/dimension/otherside.json
67f8cd0621b1c3614da8c1910f6b7bcb61660293 data/deeperdarker/dimension_type/otherside.json
0f715fda6f60117cf74eadf94c1590aea34761a3 data/deeperdarker/dimension_type/otherside.json
ad453d5b708fe189495a8e5d4ce2531d9898a555 data/deeperdarker/enchantment/catalysis.json
d5b5b78cce29a3e1eec213a0d1540c21d58a3d34 data/deeperdarker/enchantment/sculk_smite.json
729673e1d51f7ee33e7f94cff8b59ee030844d8b data/deeperdarker/painting_variant/abstraction.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ambient_light": 0.05,
"bed_works": true,
"coordinate_scale": 1.0,
"effects": "minecraft:the_nether",
"effects": "deeperdarker:otherside_effects",
"fixed_time": 18000,
"has_ceiling": true,
"has_raids": false,
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/kyanite/deeperdarker/DeeperDarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.kyanite.deeperdarker.world.DDFeatures;
import com.kyanite.deeperdarker.world.otherside.OthersideDimension;
import com.mojang.logging.LogUtils;
import net.minecraft.client.renderer.DimensionSpecialEffects;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
Expand All @@ -31,6 +32,7 @@
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.client.event.RegisterDimensionSpecialEffectsEvent;
import net.neoforged.neoforge.common.data.AdvancementProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.neoforged.neoforge.data.event.GatherDataEvent;
Expand Down Expand Up @@ -72,6 +74,7 @@ public DeeperDarker(IEventBus eventBus, ModContainer container) {
eventBus.addListener(this::registerPayloads);
eventBus.addListener(this::registerAttributes);
eventBus.addListener(this::registerSpawnPlacements);
eventBus.addListener(this::registerDimensionEffects);

container.registerConfig(ModConfig.Type.COMMON, DeeperDarkerConfig.SPEC);
}
Expand Down Expand Up @@ -134,6 +137,10 @@ private void registerSpawnPlacements(final RegisterSpawnPlacementsEvent event) {
event.register(DDEntities.SLUDGE.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Mob::checkMobSpawnRules, RegisterSpawnPlacementsEvent.Operation.REPLACE);
}

private void registerDimensionEffects(final RegisterDimensionSpecialEffectsEvent event) {
event.register(OthersideDimension.OTHERSIDE_EFFECTS, new DimensionSpecialEffects.NetherEffects());
}

public static ResourceLocation rl(String path) {
return ResourceLocation.fromNamespaceAndPath(MOD_ID, path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
import net.minecraft.world.level.dimension.DimensionType;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
Expand All @@ -20,9 +20,10 @@
public class OthersideDimension {
public static final ResourceKey<Level> OTHERSIDE_LEVEL = ResourceKey.create(Registries.DIMENSION, DeeperDarker.rl("otherside"));
public static final ResourceKey<DimensionType> OTHERSIDE = ResourceKey.create(Registries.DIMENSION_TYPE, DeeperDarker.rl("otherside"));
public static final ResourceLocation OTHERSIDE_EFFECTS = DeeperDarker.rl("otherside_effects");

public static void bootstrap(BootstrapContext<DimensionType> context) {
context.register(OTHERSIDE, new DimensionType(OptionalLong.of(18000L), false, true, false, true, 1, true, false, 0, 128, 128, DDTags.Blocks.INFINIBURN_OTHERSIDE, BuiltinDimensionTypes.NETHER_EFFECTS, 0.05f, new DimensionType.MonsterSettings(true, false, ConstantInt.of(7), 15)));
context.register(OTHERSIDE, new DimensionType(OptionalLong.of(18000L), false, true, false, true, 1, true, false, 0, 128, 128, DDTags.Blocks.INFINIBURN_OTHERSIDE, OTHERSIDE_EFFECTS, 0.05f, new DimensionType.MonsterSettings(true, false, ConstantInt.of(7), 15)));
}

public static final DeferredRegister<PoiType> POI = DeferredRegister.create(Registries.POINT_OF_INTEREST_TYPE, DeeperDarker.MOD_ID);
Expand Down

0 comments on commit 17e212a

Please sign in to comment.