Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repairing changes to Limbo options #436

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 5000;
@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 @@ -63,11 +65,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!");
destLoc = new Location(DimensionalDoors.getWorld(targetWorldResourceKey), new BlockPos(entity.blockPosition().getX(), DimensionalDoors.getConfig().getLimboConfig().escapeTargetWorldYSpawn, entity.blockPosition().getZ()));
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 @@ -366,8 +366,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