Skip to content

Commit 4064a6e

Browse files
committed
removed yaw fixing on teleport
flipping portals is better anyway
1 parent 6fe663c commit 4064a6e

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<dependency>
8181
<groupId>org.spigotmc</groupId>
8282
<artifactId>spigot</artifactId>
83-
<version>1.15.2-R0.1-SNAPSHOT</version>
83+
<version>1.13.2-R0.1-SNAPSHOT</version>
8484
<scope>provided</scope>
8585
</dependency>
8686
<dependency>

src/main/java/me/gorgeousone/netherview/listeners/TeleportListener.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)