-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NoSuchMethodException was thrown on bukkit servers
- Loading branch information
Showing
6 changed files
with
55 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.warp.coordinatesobfuscator; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public interface Bukkit { | ||
void run(Plugin plugin, Player player, Runnable runnable, Runnable fallback); | ||
|
||
void runLater(Plugin plugin, Runnable runnable, long delay); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/org/warp/coordinatesobfuscator/Craftbukkit.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,16 @@ | ||
package org.warp.coordinatesobfuscator; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class Craftbukkit implements Bukkit { | ||
@Override | ||
public void run(Plugin plugin, Player player, Runnable runnable, Runnable fallback) { | ||
org.bukkit.Bukkit.getScheduler().runTask(plugin, runnable); | ||
} | ||
|
||
@Override | ||
public void runLater(Plugin plugin, Runnable runnable, long delay) { | ||
org.bukkit.Bukkit.getScheduler().runTaskLater(plugin, runnable, delay); | ||
} | ||
} |
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,16 @@ | ||
package org.warp.coordinatesobfuscator; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class Folia implements Bukkit { | ||
@Override | ||
public void run(Plugin plugin, Player player, Runnable runnable, Runnable fallback) { | ||
player.getScheduler().run(plugin, st -> runnable.run(), fallback); | ||
} | ||
|
||
@Override | ||
public void runLater(Plugin plugin, Runnable runnable, long delay) { | ||
org.bukkit.Bukkit.getScheduler().runTaskLater(plugin, runnable, delay); | ||
} | ||
} |