Skip to content

Commit 36ccbc2

Browse files
committed
TeleportCommand.java updated for 1.15.2 forge.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 3693a55 commit 36ccbc2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/com/mairwunnx/projectessentials/core/vanilla/commands/TeleportCommand.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ public static void register(CommandDispatcher<CommandSource> dispatcher) {
5454
})).then(Commands.argument("destination", EntityArgument.entity()).executes((p_200562_0_) -> {
5555
return teleportToEntity(p_200562_0_.getSource(), Collections.singleton(p_200562_0_.getSource().assertIsEntity()), EntityArgument.getEntity(p_200562_0_, "destination"));
5656
})));
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));
6058
}
6159

6260
private static void checkPermissions(CommandSource source) {
@@ -93,7 +91,7 @@ private static int teleportToEntity(CommandSource source, Collection<? extends E
9391
checkPermissions(source);
9492

9593
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);
9795
}
9896

9997
if (targets.size() == 1) {
@@ -158,7 +156,7 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
158156
worldIn.getChunkProvider().func_217228_a(TicketType.POST_TELEPORT, chunkpos, 1, entityIn.getEntityId());
159157
entityIn.stopRiding();
160158
if (((ServerPlayerEntity) entityIn).isSleeping()) {
161-
((ServerPlayerEntity) entityIn).wakeUpPlayer(true, true, false);
159+
((ServerPlayerEntity) entityIn).func_225652_a_(true, true);
162160
}
163161

164162
if (worldIn == entityIn.world) {
@@ -199,7 +197,6 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
199197
entityIn.setMotion(entityIn.getMotion().mul(1.0D, 0.0D, 1.0D));
200198
entityIn.onGround = true;
201199
}
202-
203200
}
204201

205202
static class Facing {
@@ -229,7 +226,6 @@ public void updateLook(CommandSource source, Entity entityIn) {
229226
} else {
230227
entityIn.lookAt(source.getEntityAnchorType(), this.position);
231228
}
232-
233229
}
234230
}
235231
}

0 commit comments

Comments
 (0)