18
18
import net .minecraft .server .network .ServerPlayerEntity ;
19
19
import net .minecraft .server .world .ServerWorld ;
20
20
import net .minecraft .text .Text ;
21
- import net .minecraft .text .TranslatableText ;
22
21
import net .minecraft .util .math .BlockPos ;
23
22
import net .minecraft .world .chunk .Chunk ;
24
23
28
27
import java .util .function .Consumer ;
29
28
30
29
public class GhostShellsCommand implements Command {
31
- private static final SimpleCommandExceptionType INVALID_ACTION_TYPE = new SimpleCommandExceptionType (new TranslatableText ("command.sync.ghostshells.invalid_action" ));
30
+ private static final SimpleCommandExceptionType INVALID_ACTION_TYPE = new SimpleCommandExceptionType (Text . translatable ("command.sync.ghostshells.invalid_action" ));
32
31
33
32
@ Override
34
33
public String getName () {
@@ -93,7 +92,7 @@ private static int execute(CommandContext<ServerCommandSource> context) throws C
93
92
for (ServerPlayerEntity player : players ) {
94
93
ShellState shellState = ((Shell )player ).getAvailableShellStates ().filter (x -> x .getPos ().equals (finalPos )).findAny ().orElse (null );
95
94
if (shellState == null ) {
96
- logger .accept (new TranslatableText ("command.sync.ghostshells.not_found" , player .getName ().asString (), pos .toShortString ()));
95
+ logger .accept (Text . translatable ("command.sync.ghostshells.not_found" , player .getName ().getString (), pos .toShortString ()));
97
96
} else {
98
97
updateShell (player , shellState , repair , canSkip , logger );
99
98
}
@@ -115,18 +114,18 @@ private static void updateShell(ServerPlayerEntity player, ShellState shellState
115
114
116
115
if (shouldRepair ) {
117
116
if (tryRepair (player .server , shellState )) {
118
- logger .accept (new TranslatableText ("command.sync.ghostshells.repaired" , player .getName ().asString (), shellState .getPos ().toShortString ()));
117
+ logger .accept (Text . translatable ("command.sync.ghostshells.repaired" , player .getName ().getString (), shellState .getPos ().toShortString ()));
119
118
return ;
120
119
}
121
120
122
121
if (!skipOnFailure ) {
123
- logger .accept (new TranslatableText ("command.sync.ghostshells.failed" , player .getName ().asString (), shellState .getPos ().toShortString ()));
122
+ logger .accept (Text . translatable ("command.sync.ghostshells.failed" , player .getName ().getString (), shellState .getPos ().toShortString ()));
124
123
return ;
125
124
}
126
125
}
127
126
128
127
((Shell )player ).remove (shellState );
129
- logger .accept (new TranslatableText ("command.sync.ghostshells.removed" , player .getName ().asString (), shellState .getPos ().toShortString ()));
128
+ logger .accept (Text . translatable ("command.sync.ghostshells.removed" , player .getName ().getString (), shellState .getPos ().toShortString ()));
130
129
}
131
130
132
131
private static boolean shellExists (MinecraftServer server , ShellState shellState ) {
0 commit comments