forked from EssentialsX/Essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flight state between world teleports
Thanks to @electronicboy for the general fix Fixes EssentialsX#4325 Co-authored-by: Shane Freeder <[email protected]>
- Loading branch information
1 parent
803771e
commit b37d1ee
Showing
8 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
providers/BaseProviders/src/main/java/net/ess3/provider/TickCountProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.ess3.provider; | ||
|
||
import net.essentialsx.providers.NullableProvider; | ||
|
||
@NullableProvider | ||
public interface TickCountProvider extends Provider { | ||
int getTickCount(); | ||
} |
24 changes: 24 additions & 0 deletions
24
...iders/PaperProvider/src/main/java/net/ess3/provider/providers/PaperTickCountProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.ess3.provider.providers; | ||
|
||
import net.ess3.provider.TickCountProvider; | ||
import net.essentialsx.providers.ProviderData; | ||
import net.essentialsx.providers.ProviderTest; | ||
import org.bukkit.Bukkit; | ||
|
||
@ProviderData(description = "Paper Tick Count Provider") | ||
public class PaperTickCountProvider implements TickCountProvider { | ||
@Override | ||
public int getTickCount() { | ||
return Bukkit.getCurrentTick(); | ||
} | ||
|
||
@ProviderTest | ||
public static boolean test() { | ||
try { | ||
Bukkit.class.getDeclaredMethod("getCurrentTick"); | ||
return true; | ||
} catch (final NoSuchMethodException ignored) { | ||
return false; | ||
} | ||
} | ||
} |