Skip to content

Commit

Permalink
Add PaperLib to use teleportAsync()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed May 8, 2024
1 parent 13470a5 commit 9969218
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
<version>${viaversion.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.8</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public void EDisE(EntityDismountEvent Event) {

Entity bottom = GPM.getPassengerUtil().getBottomEntity(Event.getDismounted());

if(GPM.getCManager().PS_BOTTOM_RETURN && Event.getEntity().isValid() && Event.getEntity() instanceof Player && GPM.getPackageUtil() != null) Bukkit.getPlayer(Event.getEntity().getUniqueId()).teleport(bottom.getLocation());
if(GPM.getCManager().PS_BOTTOM_RETURN && Event.getEntity().isValid() && Event.getEntity() instanceof Player && GPM.getPackageUtil() != null) io.papermc.lib.PaperLib.teleportAsync(Event.getEntity(), bottom.getLocation());

if(Event.getDismounted().getScoreboardTags().contains(GPM.NAME + "_PlayerSeatEntity") && GPM.getPackageUtil() == null) Bukkit.getPlayer(Event.getDismounted().getUniqueId()).teleport(bottom.getLocation());
if(Event.getDismounted().getScoreboardTags().contains(GPM.NAME + "_PlayerSeatEntity") && GPM.getPackageUtil() == null) io.papermc.lib.PaperLib.teleportAsync(Event.getDismounted(), bottom.getLocation());

GPM.getPlayerSitManager().stopPlayerSit(Event.getDismounted(), GetUpReason.GET_UP);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public void EDisE(EntityDismountEvent Event) {

Entity bottom = GPM.getPassengerUtil().getBottomEntity(Event.getDismounted());

if(GPM.getCManager().PS_BOTTOM_RETURN && Event.getEntity().isValid() && Event.getEntity() instanceof Player && GPM.getPackageUtil() != null) Bukkit.getPlayer(Event.getEntity().getUniqueId()).teleportAsync(bottom.getLocation());
if(GPM.getCManager().PS_BOTTOM_RETURN && Event.getEntity().isValid() && Event.getEntity() instanceof Player && GPM.getPackageUtil() != null) io.papermc.lib.PaperLib.teleportAsync(Event.getEntity(), bottom.getLocation());

if(Event.getDismounted().getScoreboardTags().contains(GPM.NAME + "_PlayerSeatEntity") && GPM.getPackageUtil() == null) Bukkit.getPlayer(Event.getDismounted().getUniqueId()).teleportAsync(bottom.getLocation());
if(Event.getDismounted().getScoreboardTags().contains(GPM.NAME + "_PlayerSeatEntity") && GPM.getPackageUtil() == null) io.papermc.lib.PaperLib.teleportAsync(Event.getDismounted(), bottom.getLocation());

GPM.getPlayerSitManager().stopPlayerSit(Event.getDismounted(), GetUpReason.GET_UP);

Expand Down

0 comments on commit 9969218

Please sign in to comment.