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