@@ -54,9 +54,7 @@ public static void register(CommandDispatcher<CommandSource> dispatcher) {
54
54
})).then (Commands .argument ("destination" , EntityArgument .entity ()).executes ((p_200562_0_ ) -> {
55
55
return teleportToEntity (p_200562_0_ .getSource (), Collections .singleton (p_200562_0_ .getSource ().assertIsEntity ()), EntityArgument .getEntity (p_200562_0_ , "destination" ));
56
56
})));
57
- dispatcher .register (Commands .literal ("tp" ).requires ((p_200556_0_ ) -> {
58
- return p_200556_0_ .hasPermissionLevel (2 );
59
- }).redirect (literalcommandnode ));
57
+ dispatcher .register (Commands .literal ("tp" ).redirect (literalcommandnode ));
60
58
}
61
59
62
60
private static void checkPermissions (CommandSource source ) {
@@ -93,7 +91,7 @@ private static int teleportToEntity(CommandSource source, Collection<? extends E
93
91
checkPermissions (source );
94
92
95
93
for (Entity entity : targets ) {
96
- teleport (source , entity , (ServerWorld ) destination .world , destination .posX , destination .posY , destination .posZ , EnumSet .noneOf (SPlayerPositionLookPacket .Flags .class ), destination .rotationYaw , destination .rotationPitch , null );
94
+ teleport (source , entity , (ServerWorld ) destination .world , destination .func_226277_ct_ () , destination .func_226278_cu_ () , destination .func_226281_cx_ () , EnumSet .noneOf (SPlayerPositionLookPacket .Flags .class ), destination .rotationYaw , destination .rotationPitch , null );
97
95
}
98
96
99
97
if (targets .size () == 1 ) {
@@ -158,7 +156,7 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
158
156
worldIn .getChunkProvider ().func_217228_a (TicketType .POST_TELEPORT , chunkpos , 1 , entityIn .getEntityId ());
159
157
entityIn .stopRiding ();
160
158
if (((ServerPlayerEntity ) entityIn ).isSleeping ()) {
161
- ((ServerPlayerEntity ) entityIn ).wakeUpPlayer (true , true , false );
159
+ ((ServerPlayerEntity ) entityIn ).func_225652_a_ (true , true );
162
160
}
163
161
164
162
if (worldIn == entityIn .world ) {
@@ -199,7 +197,6 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
199
197
entityIn .setMotion (entityIn .getMotion ().mul (1.0D , 0.0D , 1.0D ));
200
198
entityIn .onGround = true ;
201
199
}
202
-
203
200
}
204
201
205
202
static class Facing {
@@ -229,7 +226,6 @@ public void updateLook(CommandSource source, Entity entityIn) {
229
226
} else {
230
227
entityIn .lookAt (source .getEntityAnchorType (), this .position );
231
228
}
232
-
233
229
}
234
230
}
235
231
}
0 commit comments