players keep velocity through doors now
This commit is contained in:
parent
9d2c22bdf9
commit
078e54908a
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,8 @@ package org.dimdev.dimdoors.block.entity;
|
|||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.EulerAngle;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.block.CoordinateTransformerBlock;
|
||||
|
@ -77,6 +79,11 @@ public class EntranceRiftBlockEntity extends RiftBlockEntity {
|
|||
|
||||
TeleportUtil.teleport(entity, this.world, targetPos, relativeAngle);
|
||||
entity.setVelocity(relativeVelocity);
|
||||
if (entity instanceof ServerPlayerEntity) {
|
||||
ServerPlayerEntity player = (ServerPlayerEntity) entity;
|
||||
player.networkHandler.sendPacket(new EntityVelocityUpdateS2CPacket(player));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue