-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.21] Allow looking up a Dimensions translated name (#1428)
- Loading branch information
1 parent
bd44520
commit 8d0cdee
Showing
9 changed files
with
143 additions
and
7 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
patches/net/minecraft/server/commands/ForceLoadCommand.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- a/net/minecraft/server/commands/ForceLoadCommand.java | ||
+++ b/net/minecraft/server/commands/ForceLoadCommand.java | ||
@@ -106,13 +_,13 @@ | ||
if (flag) { | ||
p_137683_.sendSuccess( | ||
() -> Component.translatable( | ||
- "commands.forceload.query.success", Component.translationArg(chunkpos), Component.translationArg(resourcekey.location()) | ||
+ "commands.forceload.query.success", Component.translationArg(chunkpos), serverlevel.getDescription() // Neo: Use dimension translation, if one exists | ||
), | ||
false | ||
); | ||
return 1; | ||
} else { | ||
- throw ERROR_NOT_TICKING.create(chunkpos, resourcekey.location()); | ||
+ throw ERROR_NOT_TICKING.create(chunkpos, serverlevel.getDescription()); // Neo: Use dimension translation, if one exists | ||
} | ||
} | ||
|
||
@@ -125,15 +_,15 @@ | ||
String s = Joiner.on(", ").join(longset.stream().sorted().map(ChunkPos::new).map(ChunkPos::toString).iterator()); | ||
if (i == 1) { | ||
p_137681_.sendSuccess( | ||
- () -> Component.translatable("commands.forceload.list.single", Component.translationArg(resourcekey.location()), s), false | ||
+ () -> Component.translatable("commands.forceload.list.single", serverlevel.getDescription(), s), false // Neo: Use dimension translation, if one exists | ||
); | ||
} else { | ||
p_137681_.sendSuccess( | ||
- () -> Component.translatable("commands.forceload.list.multiple", i, Component.translationArg(resourcekey.location()), s), false | ||
+ () -> Component.translatable("commands.forceload.list.multiple", i, serverlevel.getDescription(), s), false // Neo: Use dimension translation, if one exists | ||
); | ||
} | ||
} else { | ||
- p_137681_.sendFailure(Component.translatable("commands.forceload.added.none", Component.translationArg(resourcekey.location()))); | ||
+ p_137681_.sendFailure(Component.translatable("commands.forceload.added.none", serverlevel.getDescription())); // Neo: Use dimension translation, if one exists | ||
} | ||
|
||
return i; | ||
@@ -144,7 +_,7 @@ | ||
ResourceKey<Level> resourcekey = serverlevel.dimension(); | ||
LongSet longset = serverlevel.getForcedChunks(); | ||
longset.forEach(p_137675_ -> serverlevel.setChunkForced(ChunkPos.getX(p_137675_), ChunkPos.getZ(p_137675_), false)); | ||
- p_137696_.sendSuccess(() -> Component.translatable("commands.forceload.removed.all", Component.translationArg(resourcekey.location())), true); | ||
+ p_137696_.sendSuccess(() -> Component.translatable("commands.forceload.removed.all", serverlevel.getDescription()), true); // Neo: Use dimension translation, if one exists | ||
return 0; | ||
} | ||
|
||
@@ -189,7 +_,7 @@ | ||
() -> Component.translatable( | ||
"commands.forceload." + (p_137689_ ? "added" : "removed") + ".single", | ||
Component.translationArg(chunkpos2), | ||
- Component.translationArg(resourcekey.location()) | ||
+ serverlevel.getDescription() // Neo: Use dimension translation, if one exists | ||
), | ||
true | ||
); | ||
@@ -200,7 +_,7 @@ | ||
() -> Component.translatable( | ||
"commands.forceload." + (p_137689_ ? "added" : "removed") + ".multiple", | ||
i3, | ||
- Component.translationArg(resourcekey.location()), | ||
+ Component.translationArg(serverlevel.getDescription()), // Neo: Use dimension translation, if one exists | ||
Component.translationArg(chunkpos3), | ||
Component.translationArg(chunkpos1) | ||
), |
11 changes: 11 additions & 0 deletions
11
patches/net/minecraft/server/commands/SetSpawnCommand.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/net/minecraft/server/commands/SetSpawnCommand.java | ||
+++ b/net/minecraft/server/commands/SetSpawnCommand.java | ||
@@ -80,7 +_,7 @@ | ||
p_138652_.getY(), | ||
p_138652_.getZ(), | ||
p_138653_, | ||
- s, | ||
+ p_138650_.getLevel().getDescription(), // Neo: Use dimension translation, if one exists | ||
p_138651_.iterator().next().getDisplayName() | ||
), | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters