mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 17:15:47 +00:00
yoffset removed for nether world types
This commit is contained in:
parent
c03682b06d
commit
d8bd216294
@ -7,7 +7,7 @@
|
|||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTPAddons</artifactId>
|
<artifactId>BetterRTPAddons</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.0</version>
|
<version>1.1</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package me.SuperRonanCraft.BetterRTPAddons.addons.extraEffects;
|
package me.SuperRonanCraft.BetterRTPAddons.addons.extraEffects;
|
||||||
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.customEvents.RTP_TeleportEvent;
|
import me.SuperRonanCraft.BetterRTP.references.customEvents.RTP_TeleportEvent;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.worlds.WORLD_TYPE;
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.Main;
|
import me.SuperRonanCraft.BetterRTPAddons.Main;
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.util.Files;
|
import me.SuperRonanCraft.BetterRTPAddons.util.Files;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -35,6 +36,8 @@ public class ExtraEffectsEffect_Skyhigh implements ExtraEffectsEffect, Listener
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
void tpEvent(RTP_TeleportEvent e) {
|
void tpEvent(RTP_TeleportEvent e) {
|
||||||
|
if (e.getWorldType() == WORLD_TYPE.NETHER)
|
||||||
|
return;
|
||||||
e.changeLocation(e.getLocation().add(0, offset, 0));
|
e.changeLocation(e.getLocation().add(0, offset, 0));
|
||||||
new PlayerFalling(e.getPlayer());
|
new PlayerFalling(e.getPlayer());
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
main: me.SuperRonanCraft.BetterRTPAddons.Main
|
main: me.SuperRonanCraft.BetterRTPAddons.Main
|
||||||
version: 1.0
|
version: 1.1
|
||||||
api-version: '1.13'
|
api-version: '1.13'
|
||||||
name: BetterRTPAddons
|
name: BetterRTPAddons
|
||||||
depend: [BetterRTP]
|
depend: [BetterRTP]
|
||||||
|
42
pom.xml
42
pom.xml
@ -157,26 +157,6 @@
|
|||||||
<version>7.0.3</version>
|
<version>7.0.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Particles Library -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>xyz.xenondevs</groupId>
|
|
||||||
<artifactId>particle</artifactId>
|
|
||||||
<version>1.5.1</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- GriefPrevention (https://www.spigotmc.org/resources/griefprevention.1884/) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.TechFortress</groupId>
|
|
||||||
<artifactId>GriefPrevention</artifactId>
|
|
||||||
<version>16.15.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- Towny (https://www.spigotmc.org/resources/towny.72694/) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.TownyAdvanced</groupId>
|
|
||||||
<artifactId>Towny</artifactId>
|
|
||||||
<version>0.96.1.11</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- RedProtect (https://www.spigotmc.org/resources/redprotect.15841/) -->
|
<!-- RedProtect (https://www.spigotmc.org/resources/redprotect.15841/) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
||||||
@ -218,12 +198,32 @@
|
|||||||
<version>4.5.0</version>
|
<version>4.5.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- KingdomsX v1.10.5.2 (https://www.spigotmc.org/resources/kingdomsx.77670/) -->
|
<!-- Towny (https://www.spigotmc.org/resources/towny.72694/) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<groupId>com.github.TownyAdvanced</groupId>
|
||||||
|
<artifactId>Towny</artifactId>
|
||||||
|
<version>0.96.1.11</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- GriefPrevention (https://www.spigotmc.org/resources/griefprevention.1884/) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.TechFortress</groupId>
|
||||||
|
<artifactId>GriefPrevention</artifactId>
|
||||||
|
<version>16.15.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- KingdomsX v1.10.5.2 (https://www.spigotmc.org/resources/kingdomsx.77670/) -->
|
||||||
|
<!--dependency>
|
||||||
<groupId>com.github.cryptomorin</groupId>
|
<groupId>com.github.cryptomorin</groupId>
|
||||||
<artifactId>kingdoms</artifactId>
|
<artifactId>kingdoms</artifactId>
|
||||||
<version>1.10.5.2</version>
|
<version>1.10.5.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
|
</dependency-->
|
||||||
|
<!-- Particles Library -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>xyz.xenondevs</groupId>
|
||||||
|
<artifactId>particle</artifactId>
|
||||||
|
<version>1.5.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -30,9 +30,13 @@ public class CmdPlayer implements RTPCommand, RTPCommandHelpable {
|
|||||||
else
|
else
|
||||||
usage(sendi, label);
|
usage(sendi, label);
|
||||||
else if (args.length >= 3)
|
else if (args.length >= 3)
|
||||||
if (Bukkit.getPlayer(args[1]) != null && Bukkit.getPlayer(args[1]).isOnline())
|
if (Bukkit.getPlayer(args[1]) != null && Bukkit.getPlayer(args[1]).isOnline()) {
|
||||||
getCmd().tp(Bukkit.getPlayer(args[1]), sendi, Bukkit.getWorld(args[2]).getName(), getCmd().getBiomes(args, 3, sendi), RTP_TYPE.FORCED);
|
World world = Bukkit.getWorld(args[2]);
|
||||||
else if (Bukkit.getPlayer(args[1]) != null)
|
if (world != null) {
|
||||||
|
getCmd().tp(Bukkit.getPlayer(args[1]), sendi, world.getName(), getCmd().getBiomes(args, 3, sendi), RTP_TYPE.FORCED);
|
||||||
|
} else
|
||||||
|
BetterRTP.getInstance().getText().getNotExist(sendi, args[2]);
|
||||||
|
} else if (Bukkit.getPlayer(args[1]) != null)
|
||||||
getCmd().playerNotOnline(sendi, args[1]);
|
getCmd().playerNotOnline(sendi, args[1]);
|
||||||
else
|
else
|
||||||
usage(sendi, label);
|
usage(sendi, label);
|
||||||
|
@ -52,7 +52,7 @@ public class RTPPlayer {
|
|||||||
//Valid location?
|
//Valid location?
|
||||||
if (tpLoc != null && checkDepends(tpLoc)) {
|
if (tpLoc != null && checkDepends(tpLoc)) {
|
||||||
if (getPl().getEco().charge(p, pWorld)) {
|
if (getPl().getEco().charge(p, pWorld)) {
|
||||||
settings.teleport.sendPlayer(sendi, p, tpLoc, pWorld.getPrice(), pWorld.getAttempts(), type);
|
settings.teleport.sendPlayer(sendi, p, tpLoc, pWorld.getPrice(), pWorld.getAttempts(), type, pWorld.getWorldtype());
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
randomlyTeleport(sendi);
|
randomlyTeleport(sendi);
|
||||||
|
@ -13,9 +13,10 @@ import com.sk89q.worldguard.protection.regions.RegionContainer;
|
|||||||
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import me.angeschossen.lands.api.integration.LandsIntegration;
|
import me.angeschossen.lands.api.integration.LandsIntegration;
|
||||||
|
import me.angeschossen.lands.api.land.Land;
|
||||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.kingdoms.constants.land.Land;
|
//import org.kingdoms.constants.land.Land;
|
||||||
|
|
||||||
public class RTPPluginValidation { //Safe locations depending on enabled dependencies
|
public class RTPPluginValidation { //Safe locations depending on enabled dependencies
|
||||||
|
|
||||||
@ -147,8 +148,8 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
|||||||
boolean result = true;
|
boolean result = true;
|
||||||
if (getPl().getSettings().getsDepends().isKingdomsX())
|
if (getPl().getSettings().getsDepends().isKingdomsX())
|
||||||
try {
|
try {
|
||||||
Land land = Land.getLand(loc);
|
//Land land = Land.getLand(loc);
|
||||||
result = land == null || !land.isClaimed();
|
//result = land == null || !land.isClaimed();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package me.SuperRonanCraft.BetterRTP.player.rtp;
|
|||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.customEvents.*;
|
import me.SuperRonanCraft.BetterRTP.references.customEvents.*;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.worlds.WORLD_TYPE;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -42,7 +43,7 @@ public class RTPTeleport {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
void sendPlayer(final CommandSender sendi, final Player p, final Location location, final int price,
|
void sendPlayer(final CommandSender sendi, final Player p, final Location location, final int price,
|
||||||
final int attempts, RTP_TYPE type) throws NullPointerException {
|
final int attempts, RTP_TYPE type, WORLD_TYPE worldType) throws NullPointerException {
|
||||||
Location oldLoc = p.getLocation();
|
Location oldLoc = p.getLocation();
|
||||||
loadingTeleport(p, sendi); //Send loading message to player who requested
|
loadingTeleport(p, sendi); //Send loading message to player who requested
|
||||||
List<CompletableFuture<Chunk>> asyncChunks = getChunks(location); //Get a list of chunks
|
List<CompletableFuture<Chunk>> asyncChunks = getChunks(location); //Get a list of chunks
|
||||||
@ -52,7 +53,7 @@ public class RTPTeleport {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
RTP_TeleportEvent event = new RTP_TeleportEvent(p, location);
|
RTP_TeleportEvent event = new RTP_TeleportEvent(p, location, worldType);
|
||||||
getPl().getServer().getPluginManager().callEvent(event);
|
getPl().getServer().getPluginManager().callEvent(event);
|
||||||
Location loc = event.getLocation();
|
Location loc = event.getLocation();
|
||||||
PaperLib.teleportAsync(p, loc).thenRun(new BukkitRunnable() { //Async teleport
|
PaperLib.teleportAsync(p, loc).thenRun(new BukkitRunnable() { //Async teleport
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.customEvents;
|
package me.SuperRonanCraft.BetterRTP.references.customEvents;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.worlds.WORLD_TYPE;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
@ -9,11 +10,13 @@ public class RTP_TeleportEvent extends Event {
|
|||||||
|
|
||||||
Player p;
|
Player p;
|
||||||
Location loc;
|
Location loc;
|
||||||
|
WORLD_TYPE worldType;
|
||||||
private static final HandlerList handler = new HandlerList();
|
private static final HandlerList handler = new HandlerList();
|
||||||
|
|
||||||
public RTP_TeleportEvent(Player p, Location loc) {
|
public RTP_TeleportEvent(Player p, Location loc, WORLD_TYPE worldType) {
|
||||||
this.p = p;
|
this.p = p;
|
||||||
this.loc = loc;
|
this.loc = loc;
|
||||||
|
this.worldType = worldType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
@ -36,4 +39,8 @@ public class RTP_TeleportEvent extends Event {
|
|||||||
public void changeLocation(Location loc) {
|
public void changeLocation(Location loc) {
|
||||||
this.loc = loc;
|
this.loc = loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WORLD_TYPE getWorldType() {
|
||||||
|
return worldType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user