mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 17:15:47 +00:00
2.11.3 - Async Delays issue
Added the ability to disable delays in the config
This commit is contained in:
parent
060361c6e7
commit
b8930a510d
7
pom.xml
7
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
<version>2.11.2</version>
|
<version>2.11.3</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
@ -16,6 +16,7 @@
|
|||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<!-- Shade PaperLib into project -->
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.1.1</version>
|
||||||
@ -24,7 +25,7 @@
|
|||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>io.papermc.lib</pattern>
|
<pattern>io.papermc.lib</pattern>
|
||||||
<shadedPattern>me.SuperRonanCraft.BetterRTP.paperlib</shadedPattern> <!-- Replace this -->
|
<shadedPattern>me.SuperRonanCraft.BetterRTP.paperlib</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -37,8 +38,8 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- Local Server Building -->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<!-- Local Server Building -->
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.2.0</version>
|
||||||
|
@ -153,19 +153,24 @@ public class RTP {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Delaying? Else, just go
|
// Delaying? Else, just go
|
||||||
getPl().getCmd().rtping.put(p.getUniqueId(), true);
|
getPl().getCmd().rtping.put(p.getUniqueId(), true); //Cache player so they cant run '/rtp' again while rtp'ing
|
||||||
if (delay) {
|
if (getPl().getSettings().delayEnabled && delay) {
|
||||||
new Delay(sendi, pWorld, delayTime, cancelOnMove, cancelOnDamage);
|
new Delay(sendi, pWorld, delayTime, cancelOnMove, cancelOnDamage);
|
||||||
} else
|
} else
|
||||||
tp(sendi, pWorld);
|
tp(sendi, pWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tp(CommandSender sendi, PlayerWorld pWorld) {
|
void tp(CommandSender sendi, PlayerWorld pWorld) {
|
||||||
Location loc = randomLoc(pWorld);
|
new BukkitRunnable(){
|
||||||
if (loc != null)
|
@Override
|
||||||
teleport.sendPlayer(sendi, pWorld.getPlayer(), loc, pWorld.getPrice(), pWorld.getAttempts());
|
public void run() {
|
||||||
else
|
Location loc = randomLoc(pWorld);
|
||||||
metMax(sendi, pWorld.getPlayer(), pWorld.getPrice());
|
if (loc != null)
|
||||||
|
teleport.sendPlayer(sendi, pWorld.getPlayer(), loc, pWorld.getPrice(), pWorld.getAttempts());
|
||||||
|
else
|
||||||
|
metMax(sendi, pWorld.getPlayer(), pWorld.getPrice());
|
||||||
|
}
|
||||||
|
}.runTaskAsynchronously(getPl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compressed code for MaxAttempts being met
|
// Compressed code for MaxAttempts being met
|
||||||
|
@ -126,19 +126,10 @@ public class Commands {
|
|||||||
if (sendi == player)
|
if (sendi == player)
|
||||||
delay = true;
|
delay = true;
|
||||||
//pl.getRTP().start(player, sendi, world, biomes, delay);
|
//pl.getRTP().start(player, sendi, world, biomes, delay);
|
||||||
tpSync(player, sendi, world, biomes, delay);
|
pl.getRTP().start(player, sendi, world, biomes, delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tpSync(Player player, CommandSender sendi, String world, List<String> biomes, boolean delay) {
|
|
||||||
new BukkitRunnable(){
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
pl.getRTP().start(player, sendi, world, biomes, delay);
|
|
||||||
}
|
|
||||||
}.runTaskAsynchronously(pl);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkDelay(CommandSender sendi, Player player) {
|
private boolean checkDelay(CommandSender sendi, Player player) {
|
||||||
if (rtping.containsKey(player.getUniqueId())) //Already rtp'ing
|
if (rtping.containsKey(player.getUniqueId())) //Already rtp'ing
|
||||||
if (rtping.get(player.getUniqueId())) {
|
if (rtping.get(player.getUniqueId())) {
|
||||||
|
@ -5,17 +5,23 @@ import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
|||||||
|
|
||||||
public class Settings {
|
public class Settings {
|
||||||
|
|
||||||
public boolean debug = false;
|
public boolean debug;
|
||||||
|
public boolean delayEnabled;
|
||||||
|
//Dependencies
|
||||||
private SoftDepends depends = new SoftDepends();
|
private SoftDepends depends = new SoftDepends();
|
||||||
|
|
||||||
public void load() { //Load Settings
|
public void load() { //Load Settings
|
||||||
depends.load();
|
depends.load();
|
||||||
debug = Main.getInstance().getFiles().getType(FileBasics.FILETYPE.CONFIG).getBoolean("Settings.Debugger");
|
FileBasics.FILETYPE config = getPl().getFiles().getType(FileBasics.FILETYPE.CONFIG);
|
||||||
|
debug = config.getBoolean("Settings.Debugger");
|
||||||
|
delayEnabled = config.getBoolean("Settings.Delay.Enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoftDepends getsDepends() {
|
public SoftDepends getsDepends() {
|
||||||
return depends;
|
return depends;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Main getPl() {
|
||||||
|
return Main.getInstance();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ Settings:
|
|||||||
Time: 10
|
Time: 10
|
||||||
## Time between command and actually rtp'ing, time is in SECONDS. Set to "0" to disable delay timer #
|
## Time between command and actually rtp'ing, time is in SECONDS. Set to "0" to disable delay timer #
|
||||||
Delay:
|
Delay:
|
||||||
|
Enabled: true
|
||||||
Time: 5
|
Time: 5
|
||||||
CancelOnMove: true
|
CancelOnMove: true
|
||||||
DisableUpdater: false
|
DisableUpdater: false
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
main: me.SuperRonanCraft.BetterRTP.Main
|
main: me.SuperRonanCraft.BetterRTP.Main
|
||||||
version: '2.11.2'
|
version: '2.11.3'
|
||||||
name: BetterRTP
|
name: BetterRTP
|
||||||
author: SuperRonanCraft
|
author: SuperRonanCraft
|
||||||
softdepend: [Vault, WorldGuard, GriefPrevention, Factions]
|
softdepend: [Vault, WorldGuard, GriefPrevention, Factions]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user