···66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7788### [W.I.P]
99-- Storage is loaded in memory instead of reading it again and again, Improves speed and IO usage. (W.I.P)
1010-- Adding comments to alot of code (W.I.P)
1111-- Made it so the DeathLocation is only kept in memory
99+- Storage is loaded in memory instead of reading it again and again, Improves speed and IO usage, however there might be slightly higher memory usage.
1010+- Adding comments to a lot of code (W.I.P)
1111+- Made it so the DeathLocation (for `/back`) is only kept in memory
1212- Improved the Storage classes and functions (I'm doing proper java, yipie)
1313-- Better error handling for command suggestions
1313+- Better error handling for command suggestions.
1414- Added hover effects for warp and homes text (W.I.P)
1515-- Throw an exception when the world isn't found (when going back or home), instead of giving an incorrect notFound error.
1515+- Throw a warning and an error message when the world isn't found (when going back, going home or warping), instead of giving an incorrect notFound error.
1616- Added a new `home.defaultNone` translation key for when there is no default house set. (before this would give `home.homeless` for some reason)
1717+- Added a new `common.worldNotFound` translation key for when a world cannot be found
1818+- Added a new `common.defaultPrompt` translation key for a new "Set Default" button for `/homes`
1919+- Made it so that when printing the homes or warps, they get sent in one go.
17201821### [v1.2.2]
1922- Handled a case where the client (geyser) will return the language as uppercase instead of lowercase.
+1
README.md
···3838- [ ] `/wild` - Teleports you to a random location in the Overworld
3939- [x] `/worldspawn` - Teleports you to the worldspawn
4040- [ ] `/spawn <dimension>` - Teleports you to your spawnpoint in a dimension, defaults to your current dimension
4141+- [ ] `/previous` - Go to the last teleported location
41424243#### Improvements:
4344- [ ] Look into changing the mod into the more safe and sane kotlin (I love java)
+23
build.gradle
···11plugins {
22 // Required for NeoGradle
33 id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
44+ id "io.github.pacifistmc.forgix" version "1.2.9"
55+}
66+77+forgix {
88+ group = "dev.mrsnowy.teleport_commands"
99+ mergedJarName = "${mod_id}-${minecraft_version}-${version}.jar"
1010+1111+ // NeoForge Project Configuration
1212+ neoforge {
1313+ projectName = "neoforge" // Name of the NeoForge subproject
1414+1515+// // Mixin configuration files (if applicable)
1616+// mixin "${mod_id}.mixins.json"
1717+// mixin "${mod_id}-forge.mixins.json"
1818+ jarLocation = "build/libs/${mod_id}-neoforge-${minecraft_version}-${version}.jar"
1919+ }
2020+2121+ // Fabric Project Configuration
2222+ fabric {
2323+ projectName = "fabric" // Name of the Fabric subproject
2424+2525+ jarLocation = "build/libs/${mod_id}-fabric-${minecraft_version}-${version}.jar"
2626+ }
427}
···33public class configManager {
44// Currently nothing to see here... yet
5566+ // --- Ideas! ---
77+ // Make config options for disabling certain commands
88+ // Make config options for renaming certain commands
99+ // Make config option for changing required permission level for certain commands
1010+ // Make config for setting max homes
1111+ // Make config that adds a delay between teleports and when fighting. (in teleport function?)
1212+ // Make config that automatically deletes namedLocations (warps/homes) with invalid world id's
613}
···88import java.util.*;
99import java.util.regex.Matcher;
1010import java.util.regex.Pattern;
1111+import java.util.stream.StreamSupport;
11121213import net.minecraft.core.BlockPos;
1314import net.minecraft.core.particles.ParticleTypes;
···107108108109 // Gets the translated text for each player based on their language, this is fully server side and actually works (UNLIKE MOJANG'S TRANSLATED KEY'S WHICH ARE CLIENT SIDE) (I'm not mad, I swear!)
109110 public static MutableComponent getTranslatedText(String key, ServerPlayer player, MutableComponent... args) {
111111+ //todo! maybe make this also loaded in memory?
110112 String language = player.clientInformation().language().toLowerCase();
111113 String regex = "%(\\d+)%";
112114 Pattern pattern = Pattern.compile(regex);
···175177 return Component.literal(key);
176178 }
177179 }
180180+181181+182182+ // Gets the ids of all the worlds
183183+ public static List<String> getWorldIds() {
184184+ return StreamSupport.stream(TeleportCommands.SERVER.getAllLevels().spliterator(), false)
185185+ .map(level -> level.dimension().location().toString())
186186+ .toList();
187187+ }
188188+178189179190 // todo! test
180191 // checks if a BlockPos is safe, used by the teleportSafetyChecker.
···44I also want to thank everyone who made a translation for this mod! This makes the mod more accessible for everyone.
5566Things to know:
77-- The "%number%" are placeholders, The number indicates what it needs to be replaced with.
77+- The "%number%" are placeholders, The number indicates what it needs to be replaced with. (For example `Tpa%0%` will become `TpaHere` or `Tpa`, this allows the translations to be more flexible)
88- funny things are allowed, as long as they don't make the mod less accessible or cluttered!
991010#### Want to make a translation?
1111-1. Make a fork of the mod
1212-2. Go [here](https://minecraft.wiki/w/Language) and pick the in-game locale code for the language you want to translate
1313-3. Copy `en_us.json` and paste it in a new file called `[in-game locale code here].json`
1414-4. Translate the values in the file
1515-5. Submit a pull request with your translation :D!
1111+1. Make a fork of the mod ([Guide here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository))
1212+2. Go [here](https://minecraft.wiki/w/Language) and pick the in-game locale code for the language you want to translate. (for example: `en_us`)
1313+3. Copy `en_us.json` and paste it in a new file called `[in-game locale code here].json` (in the same directory!)
1414+4. Translate the values in the file (`"commands.teleport_commands.XX.XX": "Translate this!",`)
1515+5. Submit a pull request with your translation :D! ([Guide here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request))
16161717#### Want to improve an existing translation?
1818-1. Make a fork of the mod
1818+1. Make a fork of the mod ([Guide here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository))
19192. Modify the existing translation in the mod
2020-3. Submit a pull request with your changes :D!
2020+3. Submit a pull request with your changes :D! ([Guide here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request))
212122222323#### Credits