diff --git a/common/src/main/generated/assets/dimdoors/lang/en_us.json b/common/src/main/generated/assets/dimdoors/lang/en_us.json index aa7be9e8a..452b8d8eb 100644 --- a/common/src/main/generated/assets/dimdoors/lang/en_us.json +++ b/common/src/main/generated/assets/dimdoors/lang/en_us.json @@ -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", @@ -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", @@ -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", diff --git a/common/src/main/generated/data/c/tags/item/armors.json b/common/src/main/generated/data/c/tags/item/armors.json index 3cbfe73cf..2ac6b5f91 100644 --- a/common/src/main/generated/data/c/tags/item/armors.json +++ b/common/src/main/generated/data/c/tags/item/armors.json @@ -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" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/armor.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/armor.json index 3cbfe73cf..2ac6b5f91 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/armor.json @@ -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" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/durability.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/durability.json index 9a2822a84..6b77383f3 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/durability.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/durability.json @@ -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" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/equippable.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/equippable.json index 3cbfe73cf..2ac6b5f91 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/equippable.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/equippable.json @@ -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" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/foot_armor.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/foot_armor.json index 1642e51a5..6d85e69aa 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/foot_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/foot_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_leggings", - "dimdoors:garment_of_reality_leggings" + "dimdoors:world_thread_boots", + "dimdoors:garment_of_reality_boots" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/head_armor.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/head_armor.json index 6d85e69aa..2efb60aa7 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/head_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/head_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_boots", - "dimdoors:garment_of_reality_boots" + "dimdoors:world_thread_helmet", + "dimdoors:garment_of_reality_helmet" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/leg_armor.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/leg_armor.json index 2efb60aa7..1642e51a5 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/leg_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/leg_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_helmet", - "dimdoors:garment_of_reality_helmet" + "dimdoors:world_thread_leggings", + "dimdoors:garment_of_reality_leggings" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/enchantable/vanishing.json b/common/src/main/generated/data/minecraft/tags/item/enchantable/vanishing.json index 9a2822a84..6b77383f3 100644 --- a/common/src/main/generated/data/minecraft/tags/item/enchantable/vanishing.json +++ b/common/src/main/generated/data/minecraft/tags/item/enchantable/vanishing.json @@ -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" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/foot_armor.json b/common/src/main/generated/data/minecraft/tags/item/foot_armor.json index 1642e51a5..6d85e69aa 100644 --- a/common/src/main/generated/data/minecraft/tags/item/foot_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/foot_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_leggings", - "dimdoors:garment_of_reality_leggings" + "dimdoors:world_thread_boots", + "dimdoors:garment_of_reality_boots" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/head_armor.json b/common/src/main/generated/data/minecraft/tags/item/head_armor.json index 6d85e69aa..2efb60aa7 100644 --- a/common/src/main/generated/data/minecraft/tags/item/head_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/head_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_boots", - "dimdoors:garment_of_reality_boots" + "dimdoors:world_thread_helmet", + "dimdoors:garment_of_reality_helmet" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/minecraft/tags/item/leg_armor.json b/common/src/main/generated/data/minecraft/tags/item/leg_armor.json index 2efb60aa7..1642e51a5 100644 --- a/common/src/main/generated/data/minecraft/tags/item/leg_armor.json +++ b/common/src/main/generated/data/minecraft/tags/item/leg_armor.json @@ -1,6 +1,6 @@ { "values": [ - "dimdoors:world_thread_helmet", - "dimdoors:garment_of_reality_helmet" + "dimdoors:world_thread_leggings", + "dimdoors:garment_of_reality_leggings" ] } \ No newline at end of file diff --git a/common/src/main/java/org/dimdev/dimdoors/ModConfig.java b/common/src/main/java/org/dimdev/dimdoors/ModConfig.java index af872e60c..174fe1357 100644 --- a/common/src/main/java/org/dimdev/dimdoors/ModConfig.java +++ b/common/src/main/java/org/dimdev/dimdoors/ModConfig.java @@ -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; diff --git a/common/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java b/common/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java index 5b2f63d80..5f46df95b 100644 --- a/common/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java +++ b/common/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java @@ -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; @@ -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 )) ) @@ -171,7 +172,7 @@ private static int setChunkLoading(CommandSourceStack source, @Nullable Integer return pocket; } - private static int placePocket(CommandSourceStack source, ResourceLocation id, ResourceKey> idFunction, @Nullable Entity locatorEntity, @Nullable BlockPos selectedSourcePos) throws CommandSyntaxException { + private static int placePocket(CommandSourceStack source, ResourceLocation id, ResourceKey> 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)); @@ -185,9 +186,9 @@ private static 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()); @@ -242,6 +243,12 @@ private static 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 diff --git a/common/src/main/java/org/dimdev/dimdoors/compat/clothconfig/ClothConfigCompat.java b/common/src/main/java/org/dimdev/dimdoors/compat/clothconfig/ClothConfigCompat.java index a665b8e3a..492b055be 100644 --- a/common/src/main/java/org/dimdev/dimdoors/compat/clothconfig/ClothConfigCompat.java +++ b/common/src/main/java/org/dimdev/dimdoors/compat/clothconfig/ClothConfigCompat.java @@ -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)) diff --git a/common/src/main/java/org/dimdev/dimdoors/entity/limbo/LimboEntranceSource.java b/common/src/main/java/org/dimdev/dimdoors/entity/limbo/LimboEntranceSource.java index 5cd222958..e840c0eda 100644 --- a/common/src/main/java/org/dimdev/dimdoors/entity/limbo/LimboEntranceSource.java +++ b/common/src/main/java/org/dimdev/dimdoors/entity/limbo/LimboEntranceSource.java @@ -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); @@ -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()); + } } } } diff --git a/common/src/main/java/org/dimdev/dimdoors/item/ModArmorMaterials.java b/common/src/main/java/org/dimdev/dimdoors/item/ModArmorMaterials.java index 2afd25ebc..16be218a8 100644 --- a/common/src/main/java/org/dimdev/dimdoors/item/ModArmorMaterials.java +++ b/common/src/main/java/org/dimdev/dimdoors/item/ModArmorMaterials.java @@ -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; @@ -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, @@ -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, diff --git a/common/src/main/java/org/dimdev/dimdoors/sound/ModSoundEvents.java b/common/src/main/java/org/dimdev/dimdoors/sound/ModSoundEvents.java index 7d4c74caf..b905715a4 100644 --- a/common/src/main/java/org/dimdev/dimdoors/sound/ModSoundEvents.java +++ b/common/src/main/java/org/dimdev/dimdoors/sound/ModSoundEvents.java @@ -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"); diff --git a/common/src/main/java/org/dimdev/dimdoors/util/schematic/RelativeBlockSample.java b/common/src/main/java/org/dimdev/dimdoors/util/schematic/RelativeBlockSample.java index 84789f4b6..9450f54a9 100644 --- a/common/src/main/java/org/dimdev/dimdoors/util/schematic/RelativeBlockSample.java +++ b/common/src/main/java/org/dimdev/dimdoors/util/schematic/RelativeBlockSample.java @@ -15,7 +15,9 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.CommandBlock; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.CommandBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.phys.Vec3; @@ -79,24 +81,28 @@ public RelativeBlockSample(Schematic schematic) { public void place(BlockPos origin, ServerLevel world, boolean biomes, HolderLookup.Provider provider) { shouldUpdate = false; - this.blockDataContainer.forEach((pos, data) -> { - if(data.state != null) { - BlockPos actualPos = origin.offset(pos); + try { + this.blockDataContainer.forEach((pos, data) -> { + if(data.state != null) { + BlockPos actualPos = origin.offset(pos); - world.setBlock(actualPos, data.state, 0); + world.setBlock(actualPos, data.state, 0); - if(data.blockEntity != null) { - BlockEntity blockEntity = BlockEntity.loadStatic(actualPos, data.state, data.blockEntity, provider); - if (blockEntity != null) { - world.setBlockEntity(blockEntity); + if(data.blockEntity != null) { + BlockEntity blockEntity = BlockEntity.loadStatic(actualPos, data.state, data.blockEntity, provider); + if (blockEntity != null) { + world.setBlockEntity(blockEntity); + } } } - } - }); + }); + } finally { + shouldUpdate = true; + } - shouldUpdate = true; + this.initializePlacedCommandBlocks(origin, world); for (Map.Entry entry : this.entityContainer.entrySet()) { @@ -112,4 +118,34 @@ public void place(BlockPos origin, ServerLevel world, boolean biomes, HolderLook EntityType.create(nbt, world.getLevel()).ifPresent(world::addFreshEntity); } } -} \ No newline at end of file + + private void initializePlacedCommandBlocks(BlockPos origin, ServerLevel world) { + this.blockDataContainer.forEach((pos, data) -> { + if (data.state == null || !(data.state.getBlock() instanceof CommandBlock)) { + return; + } + + BlockPos actualPos = origin.offset(pos); + if (!(world.getBlockEntity(actualPos) instanceof CommandBlockEntity commandBlock)) { + return; + } + + BlockState state = world.getBlockState(actualPos); + if (!(state.getBlock() instanceof CommandBlock block)) { + return; + } + + boolean powered = world.hasNeighborSignal(actualPos); + commandBlock.setPowered(powered); + + if (commandBlock.getMode() == CommandBlockEntity.Mode.SEQUENCE) { + return; + } + + if (powered || commandBlock.isAutomatic()) { + commandBlock.markConditionMet(); + world.scheduleTick(actualPos, block, 1); + } + }); + } +} diff --git a/common/src/main/resources/assets/dimdoors/sounds.json b/common/src/main/resources/assets/dimdoors/sounds.json index 2bbda6a90..6181ac435 100644 --- a/common/src/main/resources/assets/dimdoors/sounds.json +++ b/common/src/main/resources/assets/dimdoors/sounds.json @@ -15,5 +15,13 @@ "white_void": { "sounds" : [ "dimdoors:white_void"] }, "bloop": { "sounds" : [ "dimdoors:bloop"]}, "tesselating_weave": { "sounds" : [ "dimdoors:tesselating_weave"]}, - "they_stare_back": { "sounds" : [ "dimdoors:they_stare_back"]} + "they_stare_back": { "sounds" : [ "dimdoors:they_stare_back"]}, + "equip_thread": { "sounds" : [ + "dimdoors:equip_thread_1", + "dimdoors:equip_thread_2", + "dimdoors:equip_thread_3", + "dimdoors:equip_thread_4", + "dimdoors:equip_thread_5", + "dimdoors:equip_thread_6" + ]} } diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_1.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_1.ogg new file mode 100644 index 000000000..3a24af15d Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_1.ogg differ diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_2.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_2.ogg new file mode 100644 index 000000000..688da92ce Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_2.ogg differ diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_3.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_3.ogg new file mode 100644 index 000000000..6d1650a31 Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_3.ogg differ diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_4.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_4.ogg new file mode 100644 index 000000000..b9267ec68 Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_4.ogg differ diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_5.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_5.ogg new file mode 100644 index 000000000..0d566abf1 Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_5.ogg differ diff --git a/common/src/main/resources/assets/dimdoors/sounds/equip_thread_6.ogg b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_6.ogg new file mode 100644 index 000000000..de44ac40a Binary files /dev/null and b/common/src/main/resources/assets/dimdoors/sounds/equip_thread_6.ogg differ diff --git a/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/ItemTagProvider.java b/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/ItemTagProvider.java index ce05a1318..5fca5398b 100644 --- a/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/ItemTagProvider.java +++ b/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/ItemTagProvider.java @@ -41,10 +41,10 @@ protected void addTags(HolderLookup.Provider arg) { ItemTags.SHARP_WEAPON_ENCHANTABLE, ItemTags.SWORDS); - addHead(ModItems.WORLD_THREAD_ARMOR.boots().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.boots().builtInRegistryHolder().key()); + addHead(ModItems.WORLD_THREAD_ARMOR.helmet().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.helmet().builtInRegistryHolder().key()); addChest(ModItems.WORLD_THREAD_ARMOR.chestplate().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.chestplate().builtInRegistryHolder().key()); - addLegs(ModItems.WORLD_THREAD_ARMOR.helmet().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.helmet().builtInRegistryHolder().key()); - addFeet(ModItems.WORLD_THREAD_ARMOR.leggings().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.leggings().builtInRegistryHolder().key()); + addLegs(ModItems.WORLD_THREAD_ARMOR.leggings().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.leggings().builtInRegistryHolder().key()); + addFeet(ModItems.WORLD_THREAD_ARMOR.boots().builtInRegistryHolder().key(), ModItems.GARMENT_OF_REALITY_ARMOR.boots().builtInRegistryHolder().key()); tag(ConventionalItemTags.MUSIC_DISCS).add( ModItems.THEY_STARE_BACK_RECORD.builtInRegistryHolder().key(), diff --git a/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/LanguageProvider.java b/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/LanguageProvider.java index f997f42ee..4be24dcc1 100644 --- a/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/LanguageProvider.java +++ b/fabric/src/main/datagen/org/dimdev/dimdoors/datagen/LanguageProvider.java @@ -351,6 +351,8 @@ public void generateTranslations(HolderLookup.Provider registryLookup, Translati builder.add("dimdoors.config.option.limbo.universalLimbo.tooltip", "When true, players are also teleported to Limbo when they die in any non-Pocket Dimension (except Limbo itself). Otherwise, players only go to Limbo if they die in a Pocket Dimension."); builder.add("dimdoors.config.option.limbo.hardcoreLimbo", "Hardcore Limbo"); builder.add("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."); + builder.add("dimdoors.config.option.limbo.genericDeathMessages", "Generic Death Messages"); + builder.add("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."); builder.add("dimdoors.config.option.limbo.limboBlocksCorruptingExitWorldAmount", "Exit World Decay Radius"); builder.add("dimdoors.config.option.limbo.limboBlocksCorruptingExitWorldAmount.tooltip", "The radius around a player in which blocks can decay upon exiting limbo."); builder.add("dimdoors.config.option.limbo.worldsLeadingToLimbo", "Worlds Leading to Limbo");