Skip to content

Commit

Permalink
Merge pull request #436 from Cephelo/1.20.1-multiplatform
Browse files Browse the repository at this point in the history
Repairing changes to Limbo options
  • Loading branch information
Waterpicker authored Dec 24, 2024
2 parents 237a1e1 + bde741e commit 45ee226
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions common/src/main/java/org/dimdev/dimdoors/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ public static class Limbo {
@Tooltip public boolean hardcoreLimbo = false;
@Tooltip public int limboReturnDistance = 100;
@Tooltip public float limboBlocksCorruptingExitWorldAmount = 5;
@Tooltip @Nullable public ResourceKey<Level> escapeTargetWorld = Level.OVERWORLD;
@Tooltip public int escapeTargetWorldYSpawn = 64;
@Tooltip public String escapeTargetWorld = "";
@Tooltip public boolean escapeToWorldSpawn = false;
public boolean shouldUseLimbo(ResourceKey<Level> level) {
return worldsLeadingToLimbo.blacklist != worldsLeadingToLimbo.list.contains(level.location().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Rotations;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
Expand Down Expand Up @@ -64,11 +66,11 @@ public boolean receiveEntity(Entity entity, Vec3 relativePos, Rotations relative
}
Location destLoc;

if (((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnPosition() != null && DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld == null && !DimensionalDoors.getConfig().getLimboConfig().escapeToWorldSpawn) {
LOGGER.log(Level.INFO, "Sending player from limbo to their spawnpoint, good luck!");
destLoc = new Location(((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnDimension(), ((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnPosition());
} else if (DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld != null && !DimensionalDoors.getConfig().getLimboConfig().escapeToWorldSpawn) {
targetWorldResourceKey = DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld;
if (((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnPosition() != null && DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld == "" && !DimensionalDoors.getConfig().getLimboConfig().escapeToWorldSpawn) {
LOGGER.log(Level.INFO, "Sending player from limbo to their spawnpoint, good luck!");
destLoc = new Location(((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnDimension(), ((ServerPlayer) entity.level().getPlayerByUUID(uuid)).getRespawnPosition());
} else if (DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld != "" && !DimensionalDoors.getConfig().getLimboConfig().escapeToWorldSpawn) {
targetWorldResourceKey = ResourceKey.create(Registries.DIMENSION, ResourceLocation.tryParse(DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorld);
if (DimensionalDoors.getWorld(targetWorldResourceKey) != null) {
LOGGER.log(Level.INFO, "Sending player from limbo to the exit dimension, good luck!");
var level = DimensionalDoors.getWorld(targetWorldResourceKey);
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/dimdoors/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@
"text.autoconfig.dimdoors.option.limbo.limboReturnDistance": "Limbo Return Radius",
"text.autoconfig.dimdoors.option.limbo.escapeTargetWorld": "Escape To World",
"text.autoconfig.dimdoors.option.limbo.escapeTargetWorld.@Tooltip": "Defines the id of the world players will spawn in upon exiting Limbo. Leaving this blank will spawn players in the world their respawn point is in.",
"text.autoconfig.dimdoors.option.limbo.escapeTargetWorldYSpawn": "Escape To World Y Level",
"text.autoconfig.dimdoors.option.limbo.escapeTargetWorldYSpawn.@Tooltip": "Defines the Y coordinate the player will spawn at when using \"Escape To World\"",
"text.autoconfig.dimdoors.option.limbo.escapeToWorldSpawn": "Escape to World Spawn",
"text.autoconfig.dimdoors.option.limbo.escapeToWorldSpawn.@Tooltip": "Boolean that determines if players exiting limbo will return relative to the worldspawn instead. If true, escapeTargetWorld has no effect.",

Expand Down

0 comments on commit 45ee226

Please sign in to comment.