Skip to content

Commit

Permalink
Update for Cobweb 1.3.0 and SSP 2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Jan 1, 2025
1 parent faaaf93 commit 50cabbe
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions common/src/main/java/it/crystalnest/nightworld/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package it.crystalnest.nightworld;

import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.ApiStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -14,6 +18,11 @@ public final class Constants {
*/
public static final String MOD_ID = "nightworld";

/**
* Nightworld dimension {@link ResourceKey}.
*/
public static final ResourceKey<Level> NIGHTWORLD = ResourceKey.create(Registries.DIMENSION, ResourceLocation.fromNamespaceAndPath(MOD_ID, "nightworld"));

/**
* Mod logger.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private NetherPortalBlockMixin() {
@SuppressWarnings({"JavadocReference", "StatementWithEmptyBody"})
@Inject(method = "randomTick", at = @At(value = "HEAD"), cancellable = true)
private void onRandomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random, CallbackInfo ci) {
if (level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && random.nextInt(500) < level.getDifficulty().getId() && CustomPortalChecker.isPortalForDimension(level, pos.above(), Constants.MOD_ID)) {
if (level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && random.nextInt(500) < level.getDifficulty().getId() && CustomPortalChecker.isPortalForDimension(level, pos.above(), Constants.NIGHTWORLD)) {
BlockPos bottom;
for (bottom = pos; level.getBlockState(bottom).is(this); bottom = bottom.below());
if (random.nextInt(0, 10) < 5) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "server_sided_portals:nightworld",
"type": "nightworld:nightworld",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ neoforge_loader_version_range = [21.4,)

# Dependencies
cobweb_version = 1.3.0
server_sided_portals_version = 1.1.1
server_sided_portals_version = 2.0.0

# Gradle
org.gradle.jvmargs = -Xmx4G
Expand Down

0 comments on commit 50cabbe

Please sign in to comment.