@@ -84,14 +84,14 @@ private boolean createPortalView(PlayerTeleportEvent event) {
8484
8585 //might happen if the player mysteriously moved more than a block away from the portal in split seconds
8686 if (portalBlock == null ) {
87- MessageUtils .printDebug ("No portal found at starting block " + new BlockVec (from ).toString ());
87+ MessageUtils .printDebug ("No portal found to teleport from at location [" + from . getWorld (). getName () + "," + new BlockVec (from ).toString () + "]" );
8888 return false ;
8989 }
9090
9191 Block counterPortalBlock = PortalLocator .getNearbyPortalBlock (to );
9292
9393 if (counterPortalBlock == null ) {
94- MessageUtils .printDebug ("No portal found at destination block " + new BlockVec (to ).toString ());
94+ MessageUtils .printDebug ("No portal found to teleport to at location [" + to . getWorld (). getName () + "," + new BlockVec (to ).toString () + "]" );
9595 return false ;
9696 }
9797
@@ -100,7 +100,6 @@ private boolean createPortalView(PlayerTeleportEvent event) {
100100 Portal counterPortal = portalHandler .getPortalByBlock (counterPortalBlock );
101101
102102 if (portal .getCounterPortal () == counterPortal ) {
103- event .setTo (createTpDestinationWithFixedYaw (from , to , portal .getTpTransform ()));
104103 return false ;
105104 }
106105
@@ -120,17 +119,4 @@ private boolean createPortalView(PlayerTeleportEvent event) {
120119 return false ;
121120 }
122121 }
123-
124- /**
125- * Makes sure that the yaw of a nether portal teleport changes according to transform that was calculated to
126- * create the view animation of a portal. E.g. portals leaned against walls have the tendency to differ
127- * from my basic rotation calculation. <p>
128- * This only work for 1.15 and higher though (I didn't test 1.14 yet)
129- */
130- private Location createTpDestinationWithFixedYaw (Location from , Location to , Transform portalTransform ) {
131-
132- Location fixedDestination = to .clone ();
133- fixedDestination .setYaw (portalTransform .rotateYaw (from .getYaw ()));
134- return fixedDestination ;
135- }
136122}
0 commit comments