···55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7788+### [v1.2.0] WIP!
99+- Added the following warp related commands: `/warp` `/setwarp` `/delwarp` `/renamewarp` and `/warps`
1010+- Improved error handling and error messages a lot, this will make bug reporting (and fixing) a lot easier since it says on what command it fails, and it also gives a stack trace.
1111+- Fixed some small things which may cause errors.
1212+- Improved code of some commands to make them more sane and readable
1313+- Modified storage code to make it more sane
1414+- Fixed bug with /home when in a diff dimension. (apparently I did this for /back already but forgot to add it to /home)
1515+- Added Russian Translations (Thanks to [rfin0](https://github.com/rfin0))
816917### [v1.1.3]
1018- Added support for 1.21.2 - 1.21.3
1111-12191320### [v1.1.2]
1421- Added Italian Translations (Thanks to [Vlad Andrei Morariu](https://github.com/VladAndreiMorariu)
+13-6
README.md
···77#### Currently available commands:
8899- `/back [<Disable Safety>]` - Teleports you to the location where you last died, if given true it will not do safety checks
1010-<br>
1111-1010+<br><br>
1111+ **Homes are player specific locations that only that player can teleport to**
1212- `/sethome <name>` - Creates a new home
1313-- `/home [<name>]` - Teleports you home, if no name is giving it will go to the default home
1313+- `/home [<name>]` - Teleports you to the home, if no name is giving it will go to the default home
1414- `/delhome <name>` - Deletes a home
1515- `/renamehome <name> <newName>` - Renames a home
1616- `/homes` - Shows a list of your homes
1717- `/defaulthome <name>` - Sets the default home
1818-<br>
1919-1818+<br><br>
1919+ **Warps are op managed locations that all players can teleport to**
2020+- `/warp <name>` - Teleports you to the warp
2121+- `/warps` - Shows a list of the available warp
2222+- `/setwarp <name>` - Sets a warp. Permission level of 4 required (op)
2323+- `/delwarp <name>` - Deletes a warp. Permission level of 4 required (op)
2424+- `/renamewarp <name> <newName>` - Renames a warp. Permission level of 4 required (op)
2525+<br><br>
2626+ **With tpa you can teleport to other players or make them teleport to you**
2027- `/tpa <player>` - Sends a tpa request to another player
2128- `/tpahere <player>` - Sends a tpaHere request to another player
2222-- `/tpaaccept <player>` - Accepts the tpa/ tpahere request of that player
2929+- `/tpaaccept <player>` - Accepts the tpa/tpahere request of that player
2330- `/tpadeny <player>` - Denies the tpa/tpaHere request of that player
24312532<br>
···2233import com.google.gson.Gson;
44import com.google.gson.GsonBuilder;
55+import com.mojang.datafixers.util.Pair;
56import dev.mrsnowy.teleport_commands.TeleportCommands;
6778import java.io.File;
···3435 if (new File(String.valueOf(STORAGE_FILE)).length() == 0) {
3536 StorageClass root = new StorageClass();
3637 root.Players = new ArrayList<>();
3838+ root.Warps = new ArrayList<>();
3739 StorageSaver(root);
3840 }
39414042 } catch (Exception e) {
4141- TeleportCommands.LOGGER.error(e.getMessage());
4343+ TeleportCommands.LOGGER.error("Error while creating the storage file! Exiting! {}", e.getMessage());
4244 // crashing is probably better here, otherwise the whole mod will be broken
4345 System.exit(1);
4446 }
···46484749 public static void StorageAdd(String UUID) throws Exception {
4850 StorageClass storage = StorageRetriever();
4949-// Optional<StorageClass.Player> playerStorage = GetPlayerStorage(UUID, storage);
5151+5052 Optional<StorageClass.Player> playerStorage = storage.Players.stream()
5153 .filter(player -> Objects.equals(UUID, player.UUID))
5254 .findFirst();
···56585759 newPlayer.UUID = UUID;
5860 newPlayer.DefaultHome = "";
5959- newPlayer.deathLocation = new StorageClass.Player.Location();
6060- newPlayer.deathLocation.x = new StorageClass.Player.Location().x;
6161- newPlayer.deathLocation.y = new StorageClass.Player.Location().y;
6262- newPlayer.deathLocation.z = new StorageClass.Player.Location().z;
6161+ newPlayer.deathLocation = new StorageClass.Location();
6262+ newPlayer.deathLocation.x = new StorageClass.Location().x;
6363+ newPlayer.deathLocation.y = new StorageClass.Location().y;
6464+ newPlayer.deathLocation.z = new StorageClass.Location().z;
6365 newPlayer.deathLocation.world = "";
64666567 newPlayer.Homes = new ArrayList<>();
···9092 return gson.fromJson(jsonContent, StorageClass.class);
9193 }
92949393- public static PlayerStorageClass GetPlayerStorage(String UUID) throws Exception {
9595+ public static Pair<StorageClass, List<StorageClass.NamedLocation>> getWarpStorage() throws Exception {
9696+ StorageClass storage = StorageRetriever();
9797+ return new Pair<>(storage, storage.Warps);
9898+ }
9999+100100+101101+ public static Pair<StorageClass, StorageClass.Player> GetPlayerStorage(String UUID) throws Exception {
94102 StorageClass storage = StorageRetriever();
9510396104 Optional<StorageClass.Player> playerStorage = storage.Players.stream()
···111119 }
112120 }
113121114114- return new PlayerStorageClass(storage, playerStorage.get());
122122+ return new Pair<>(storage, playerStorage.get());
115123 }
116124117117- public static class PlayerStorageClass {
118118- public StorageClass storage;
119119- public StorageClass.Player playerStorage;
120120-121121- public PlayerStorageClass(StorageClass storage, StorageClass.Player playerStorage) {
122122- this.storage = storage;
123123- this.playerStorage = playerStorage;
124124- }
125125- }
126125127126 public static class StorageClass {
127127+ public List<NamedLocation> Warps;
128128 public List<Player> Players;
129129130130+ public static class NamedLocation {
131131+ public String name;
132132+ public int x;
133133+ public int y;
134134+ public int z;
135135+ public String world;
136136+ }
137137+138138+ public static class Location {
139139+ public int x;
140140+ public int y;
141141+ public int z;
142142+ public String world;
143143+ }
144144+130145 public static class Player {
131146 public String UUID;
132147 public String DefaultHome;
133148 public Location deathLocation;
134134- public List<Home> Homes;
135135-136136- public static class Location {
137137- public int x;
138138- public int y;
139139- public int z;
140140- public String world;
141141- }
142142-143143- public static class Home {
144144- public String name;
145145- public int x;
146146- public int y;
147147- public int z;
148148- public String world;
149149- }
149149+ public List<NamedLocation> Homes;
150150 }
151151 }
152152}
···44 "commands.teleport_commands.back.noLocation": "Geen Locatie Gevonden!",
5566 "commands.teleport_commands.home.set": "Huis Ingesteld",
77- "commands.teleport_commands.home.setError": "Probleem Met Het Huis Instellen!",
77+ "commands.teleport_commands.home.setError": "Probleem tijdens het instellen van het Huis!",
88 "commands.teleport_commands.home.go": "Naar Huis",
99 "commands.teleport_commands.home.goError": "Probleem Met Naar Huis Gaan!",
1010 "commands.teleport_commands.home.goSame": "Al Thuis",
1111 "commands.teleport_commands.home.delete": "Huis Verwijderd",
1212 "commands.teleport_commands.home.deleteError": "Probleem Met Het Verwijderen Van Het Huis!",
1313 "commands.teleport_commands.home.rename": "Huis Hernoemd",
1414- "commands.teleport_commands.home.renameError": "Probleem Met Het Huis Hernamen!",
1515- "commands.teleport_commands.home.renameExists": "Die Naam Bestaat Al!",
1414+ "commands.teleport_commands.home.renameError": "Probleem tijdens het wijzigen van de huis naam!",
1615 "commands.teleport_commands.home.default": "Standaard Huis Ingesteld",
1716 "commands.teleport_commands.home.defaultError": "Probleem Tijdens Het Wijzigen Van Het Standaard Huis!",
1817 "commands.teleport_commands.home.defaultSame": "Huis is al als standaard ingesteld!",
···22212322 "commands.teleport_commands.homes.error": "Probleem Bij Het Ophalen Van De Huizen!",
2423 "commands.teleport_commands.homes.homes": "Huizen:",
2525- "commands.teleport_commands.homes.default": "(Standaard)",
2626- "commands.teleport_commands.homes.tp": "[Tp]",
2727- "commands.teleport_commands.homes.rename ": "[Naam Wijzigen]",
2828- "commands.teleport_commands.homes.delete": "[Verwijderen]",
2424+2525+ "commands.teleport_commands.warp.set": "Warp Ingesteld",
2626+ "commands.teleport_commands.warp.setError": "Probleem tijdens het instellen van de warp!",
2727+ "commands.teleport_commands.warp.exists": "Die warp bestaad Al!",
2828+ "commands.teleport_commands.warp.go": "Naar de warp",
2929+ "commands.teleport_commands.warp.goSame": "Al bij de warp",
3030+ "commands.teleport_commands.warp.goError": "Probleem met naar de warp gaan!",
3131+ "commands.teleport_commands.warp.delete": "Warp verwijderd",
3232+ "commands.teleport_commands.warp.deleteError": "Probleem tijdens het verwijderen van de warp!",
3333+ "commands.teleport_commands.warp.rename": "Warp Hernoemd",
3434+ "commands.teleport_commands.warp.renameError": "Probleem tijdens het wijzigen van de warp naam!",
3535+ "commands.teleport_commands.warp.notFound": "Warp niet gevonden!",
3636+ "commands.teleport_commands.warp.homeless": "Er zijn geen warps!",
3737+3838+ "commands.teleport_commands.warps.error": "Probleem bij get ophalen van de warps!",
3939+ "commands.teleport_commands.warps.warps": "Warps:",
29403041 "commands.teleport_commands.tpa.self": "Welp, Dat Was Makkelijk",
3142 "commands.teleport_commands.tpa.alreadySent": "Er is al een verzoek verzonden naar %0%",
···4253 "commands.teleport_commands.common.error": "Probleem tijdens het Teleporteren!",
4354 "commands.teleport_commands.common.noSafeLocation": "Geen veilige locatie gevonden!",
4455 "commands.teleport_commands.common.safetyIsForLosers": "Toch teleporteren? (Waarschuwing, je kan dood gaan!)",
4545- "commands.teleport_commands.common.forceTeleport": "[Geforceerd Teleporteren]"
5656+ "commands.teleport_commands.common.forceTeleport": "[Geforceerd Teleporteren]",
5757+ "commands.teleport_commands.common.tp": "[Tp]",
5858+ "commands.teleport_commands.common.rename ": "[Naam Wijzigen]",
5959+ "commands.teleport_commands.common.delete": "[Verwijderen]",
6060+ "commands.teleport_commands.common.default": "(Standaard)",
6161+ "commands.teleport_commands.common.renameExists": "Die Naam Bestaat Al!"
4662}