Skip to content
Open
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
9 changes: 6 additions & 3 deletions common/src/main/generated/assets/dimdoors/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@
"dimdoors.config.option.decay.decayDelay": "Decay Delay",
"dimdoors.config.option.decay.decayDelay.tooltip": "In minecraft ticks (20 per second on a healthy server or game), the delay between when a queued decay is scheduled and it fired.",
"dimdoors.config.option.decay.decaySpreadChance": "Decay Spread Chance",
"dimdoors.config.option.decay.decaySpreadChance.tooltip": "To be filled out.",
"dimdoors.config.option.decay.decaySpreadChance.tooltip": "The chance that, when random ticked, a block that can decay adjacent blocks will do so.",
"dimdoors.config.option.decay.decaysIntoAir": "Decays Into Air",
"dimdoors.config.option.decay.decaysIntoAir.tooltip": "To be filled out.",
"dimdoors.config.option.decay.decaysIntoAir.tooltip": "When true, blocks that produce World Thread when decaying will turn into air instead of their next decay step.",
"dimdoors.config.option.doors.closeDoorBehind": "Close Door Behind",
"dimdoors.config.option.doors.closeDoorBehind.tooltip": "When true, Dimensional Doors will automatically close when the player enters their portal.",
"dimdoors.config.option.doors.doorList": "Doors",
Expand Down Expand Up @@ -468,6 +468,8 @@
"dimdoors.config.option.limbo.escapeToWorldSpawn.tooltip": "Boolean that determines if players exiting limbo will return relative to the worldspawn instead. If true, escapeTargetWorld has no effect.",
"dimdoors.config.option.limbo.hardcoreLimbo": "Hardcore Limbo",
"dimdoors.config.option.limbo.hardcoreLimbo.tooltip": "When true, a player dying in Limbo will respawn in Limbo, making Eternal Fluid or Golden Dimensional Doors the only way to escape Limbo.",
"dimdoors.config.option.limbo.genericDeathMessages": "Generic Death Messages",
"dimdoors.config.option.limbo.genericDeathMessages.tooltip": "When true, instead of using custom death messages, \"...and was sent to Limbo\" will be added to the end of regular death messages.",
"dimdoors.config.option.limbo.limboBlocksCorruptingExitWorldAmount": "Exit World Decay Radius",
"dimdoors.config.option.limbo.limboBlocksCorruptingExitWorldAmount.tooltip": "The radius around a player in which blocks can decay upon exiting limbo.",
"dimdoors.config.option.limbo.limboReturnDistance": "Limbo Return Radius",
Expand Down Expand Up @@ -629,12 +631,13 @@
"item.dimdoors.world_thread_leggings": "Woven World Thread Leggings",
"itemGroup.dimdoors.decay": "Decay",
"itemGroup.dimdoors.dimensional_doors": "Dimensional Doors",
"limbo.death.generic": " and was sent to Limbo",
"limbo.death.attack.anvil": "%1$s was squashed into Limbo by a falling anvil",
"limbo.death.attack.anvil.player": "%1$s was squashed into Limbo by a falling anvil whilst fighting %2$s",
"limbo.death.attack.arrow": "%1$s was shot by %2$s and was sent to Limbo",
"limbo.death.attack.arrow.item": "%1$s was shot by %2$s using %3$s and was sent to Limbo",
"limbo.death.attack.badRespawnPoint.link": "Intentional Game Design",
"limbo.death.attack.badRespawnPoint.message": "%1$s was killed by %2$s and was sent by Limbo",
"limbo.death.attack.badRespawnPoint.message": "%1$s was killed by %2$s and was sent to Limbo",
"limbo.death.attack.cactus": "%1$s pricked a hole in reality",
"limbo.death.attack.cactus.player": "%1$s walked into a cactus whilst trying to escape %2$s and was sent to Limbo",
"limbo.death.attack.cramming": "%1$s was squished too much ans sent to Limbo",
Expand Down
10 changes: 5 additions & 5 deletions common/src/main/generated/data/c/tags/item/armors.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"values": [
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:garment_of_reality_leggings",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"values": [
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:garment_of_reality_leggings",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"values": [
"dimdoors:rift_blade",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:garment_of_reality_leggings",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"values": [
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:garment_of_reality_leggings",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet"
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
]
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"values": [
"dimdoors:rift_blade",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet",
"dimdoors:world_thread_chestplate",
"dimdoors:garment_of_reality_chestplate",
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:garment_of_reality_leggings",
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_boots",
"dimdoors:garment_of_reality_boots"
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"dimdoors:world_thread_helmet",
"dimdoors:garment_of_reality_helmet"
"dimdoors:world_thread_leggings",
"dimdoors:garment_of_reality_leggings"
]
}
1 change: 1 addition & 0 deletions common/src/main/java/org/dimdev/dimdoors/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public static class Monoliths {
public static class Limbo {
@Option private final WorldList worldsLeadingToLimbo = new WorldList();
@Option public boolean hardcoreLimbo = false;
@Option public boolean genericDeathMessages = false;

@Option public int limboReturnDistanceMax = 200;
@Option public int limboReturnDistanceMin = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.dimdev.dimdoors.ModRegistryKeys;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.block.RiftVariantProvider;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.item.RiftSignatureItem;
import org.dimdev.dimdoors.pockets.PocketCreator;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
Expand Down Expand Up @@ -67,15 +68,15 @@ public class PocketCommand {
context.getSource(),
ResourceLocationArgument.getId(context, "id"),
resourceKey,
context.getSource().getPlayerOrException(),
null,
null
))
.then(argument("locator", EntityArgument.entity())
.then(argument("target", EntityArgument.entity())
.executes(context -> placePocket(
context.getSource(),
ResourceLocationArgument.getId(context, "id"),
resourceKey,
EntityArgument.getEntity(context, "locator"),
EntityArgument.getEntity(context, "target"),
null
))
)
Expand Down Expand Up @@ -171,7 +172,7 @@ private static int setChunkLoading(CommandSourceStack source, @Nullable Integer
return pocket;
}

private static <T extends PocketCreator> int placePocket(CommandSourceStack source, ResourceLocation id, ResourceKey<Registry<T>> idFunction, @Nullable Entity locatorEntity, @Nullable BlockPos selectedSourcePos) throws CommandSyntaxException {
private static <T extends PocketCreator> int placePocket(CommandSourceStack source, ResourceLocation id, ResourceKey<Registry<T>> idFunction, @Nullable Entity targetEntity, @Nullable BlockPos selectedSourcePos) throws CommandSyntaxException {
PocketCreator creator = source.registryAccess().registry(idFunction).map(a -> a.get(id)).orElse(null);
if (creator == null) {
source.sendFailure(Component.literal("Unknown pocket id: " + id));
Expand All @@ -185,9 +186,9 @@ private static <T extends PocketCreator> int placePocket(CommandSourceStack sour
if (selectedSourcePos != null) {
sourceLevel = player.serverLevel();
sourcePos = normalizeSourcePos(sourceLevel, selectedSourcePos);
} else if (locatorEntity != null) {
sourceLevel = (ServerLevel) locatorEntity.level();
sourcePos = normalizeSourcePos(sourceLevel, locatorEntity.blockPosition());
} else if (targetEntity != null) {
sourceLevel = (ServerLevel) targetEntity.level();
sourcePos = normalizeSourcePos(sourceLevel, targetEntity.blockPosition());
} else {
sourceLevel = player.serverLevel();
sourcePos = normalizeSourcePos(sourceLevel, player.blockPosition());
Expand Down Expand Up @@ -242,6 +243,12 @@ private static <T extends PocketCreator> int placePocket(CommandSourceStack sour
}

TemplateUtils.linkRifts(contextLocation, entrance);
if (targetEntity != null
&& !((RiftBlockEntity) contextLocation.getBlockEntity()).teleport(targetEntity)) { // This line does not feel safe but theoretically any block entity errors would happen inside linkRifts
source.sendFailure(Component.literal("Failed to teleport entity through created rift."));
return 0;
}

source.sendSuccess(() -> Component.literal(
"Linked " + linkedSourcePos.toShortString()
+ " to " + id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public static Screen createScreen(Screen parent) {
worldsLeadingToLimbo.list.addAll(value);
}))
.addEntry(createBoolean(entryBuilder, "limbo.hardcoreLimbo", limbo.hardcoreLimbo, false, value -> limbo.hardcoreLimbo = value))
.addEntry(createBoolean(entryBuilder, "limbo.genericDeathMessages", limbo.genericDeathMessages, false, value -> limbo.genericDeathMessages = value))
.addEntry(createInt(entryBuilder, "limbo.limboReturnDistanceMax", limbo.limboReturnDistanceMax, 200, value -> limbo.limboReturnDistanceMax = value))
.addEntry(createInt(entryBuilder, "limbo.limboReturnDistanceMin", limbo.limboReturnDistanceMin, 100, value -> limbo.limboReturnDistanceMin = value))
.addEntry(createBoolean(entryBuilder, "limbo.decaySurroundings", limbo.decaySurroundings, false, value -> limbo.decaySurroundings = value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.player.Player;
import org.dimdev.dimdoors.DimensionalDoors;

public abstract class LimboEntranceSource {
public abstract Component getMessage(Player player);
Expand All @@ -26,8 +27,15 @@ private LimboDeathEntranceSource(DamageSource damageSource) {

@Override
public Component getMessage(Player player) {
TranslatableContents message = (TranslatableContents) this.damageSource.getLocalizedDeathMessage(player).getContents();
return Component.translatable("limbo." + message.getKey(), message.getArgs());
if (DimensionalDoors.getConfig().getLimboConfig().genericDeathMessages)
{
return this.damageSource.getLocalizedDeathMessage(player).copy().append(Component.translatable("limbo.death.generic"));
}
else
{
TranslatableContents message = (TranslatableContents) this.damageSource.getLocalizedDeathMessage(player).getContents();
return Component.translatable("limbo." + message.getKey(), message.getArgs());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import net.minecraft.Util;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import org.dimdev.dimdoors.DimensionalDoors;
import org.dimdev.dimdoors.sound.ModSoundEvents;

import java.util.HashMap;
import java.util.List;
Expand All @@ -19,7 +20,7 @@ public class ModArmorMaterials {
public static final ArmorMaterial GARMENT_OF_REALITY = register(
"garment_of_reality",
15,
SoundEvents.ARMOR_EQUIP_LEATHER,
BuiltInRegistries.SOUND_EVENT.wrapAsHolder(ModSoundEvents.ARMOR_EQUIP_THREAD), // This feels hacky but it was in neoforge docs
() -> () -> Ingredient.of(Items.STONE),
new int[]{1, 2, 3, 1},
0.0F,
Expand All @@ -28,7 +29,7 @@ public class ModArmorMaterials {
public static final ArmorMaterial WORLD_THREAD = register(
"world_thread",
15,
SoundEvents.ARMOR_EQUIP_LEATHER,
BuiltInRegistries.SOUND_EVENT.wrapAsHolder(ModSoundEvents.ARMOR_EQUIP_THREAD),
() -> () -> Ingredient.of(Items.STONE),
new int[]{1, 2, 3, 1},
0.0F,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public final class ModSoundEvents {
public static final SoundEvent DOOR_LOCK_REMOVED = register("door_lock_removed");
public static final SoundEvent KEY_LOCK = register("key_lock");
public static final SoundEvent KEY_UNLOCKED = register("key_unlock");
public static final SoundEvent ARMOR_EQUIP_THREAD = register("equip_thread");
public static final SoundEvent MONK = register("monk");
public static final SoundEvent RIFT = register("rift");
public static final SoundEvent RIFT_CLOSE = register("rift_close");
Expand Down
Loading