Skip to content

Commit 7c4b12f

Browse files
committed
zHomes 2.1.6
1 parent b56ed25 commit 7c4b12f

7 files changed

Lines changed: 440 additions & 422 deletions

File tree

dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>me.yleoft</groupId>
55
<artifactId>zHomes</artifactId>
66
<name>zHomes</name>
7-
<version>2.1.5-SNAPSHOT</version>
7+
<version>2.1.6</version>
88
<description>Your new favorite homes plugin</description>
99
<url>https://github.com/yL3oft/zHomes</url>
1010
<developers>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.yleoft</groupId>
88
<artifactId>zHomes</artifactId>
9-
<version>2.1.5</version>
9+
<version>2.1.6</version>
1010
<description>Your new favorite homes plugin</description>
1111
<url>https://github.com/yL3oft/zHomes</url>
1212
<packaging>jar</packaging>

src/main/java/me/yleoft/zHomes/Main.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ public void loadCommands() {
369369
registerPermission(cfgu.CmdHomeRenamePermission(), "Permission to use the '/" + cfgu.CmdHomeCommand() + " rename (Home) (NewName)' command", PermissionDefault.TRUE);
370370
registerPermission(cfgu.CmdHomeOthersPermission(), "Permission to use the '/" + cfgu.CmdHomeCommand() + " (Player:Home)' command", PermissionDefault.OP);
371371
registerPermission(cfgu.PermissionBypassLimit(), "Bypass homes limit", PermissionDefault.OP);
372+
registerPermission(cfgu.PermissionBypassST(), "Bypass safe teleport", PermissionDefault.FALSE);
372373
registerPermission(cfgu.PermissionBypassDT(), "Bypass dimensional teleportation config", PermissionDefault.OP);
373374
registerPermission(cfgu.PermissionBypassWarmup(), "Bypass teleportation warmup time", PermissionDefault.OP);
374375
} catch (Exception e) {

src/main/java/me/yleoft/zHomes/storage/DatabaseConnection.java

Lines changed: 424 additions & 419 deletions
Large diffs are not rendered by default.

src/main/java/me/yleoft/zHomes/utils/ConfigUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public String prefix() {
4040
}
4141

4242
//<editor-fold desc="Plugin Information">
43+
public boolean enableSafeTeleport() {
44+
return main.getConfig().getBoolean(this.tpo + "enable-safe-teleport");
45+
}
4346
public boolean canDimensionalTeleport() {
4447
return main.getConfig().getBoolean(this.tpo + "dimensional-teleportation");
4548
}
@@ -217,6 +220,9 @@ public String PermissionBypassLimit() {
217220
public String PermissionBypassDT() {
218221
return main.getConfig().getString(permissionsBypassPath+"dimensional-teleportation");
219222
}
223+
public String PermissionBypassST() {
224+
return main.getConfig().getString(permissionsBypassPath+"safe-teleportation");
225+
}
220226
public String PermissionBypassWarmup() {
221227
return main.getConfig().getString(permissionsBypassPath+"warmup");
222228
}

src/main/java/me/yleoft/zHomes/utils/HomesUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void teleportPlayer(Player p, OfflinePlayer t, String home) {
8888
SchedulerUtils.runTask(loc, new FoliaRunnable() {
8989
@Override
9090
public void run() {
91-
Location tpLoc = findNearestSafeLocation(loc, 4, 50);
91+
Location tpLoc = (enableSafeTeleport() && !p.hasPermission(PermissionBypassST())) ? findNearestSafeLocation(loc, 4, 50) : loc;
9292
if(tpLoc == null) {
9393
LanguageUtils.CommandsMSG cmdm = new LanguageUtils.CommandsMSG();
9494
cmdm.sendMsg(p, cmdm.getUnableToFindSafeLocation());

src/main/resources/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ general:
4040

4141
# In this section you can change the teleport options for the players
4242
teleport-options:
43+
# This option defines if the plugin should check for a safe location upon trying to teleport to a home.
44+
# OPTIONS: [true, false] --- DEFAULT: true
45+
enable-safe-teleport: true
4346
# This option defines if the players can teleport to other dimensions with homes.
4447
# OPTIONS: [true, false] --- DEFAULT: true
4548
dimensional-teleportation: true # There is also a permission to bypass in permissions.bypass.dimensional-teleportation in this file
@@ -157,6 +160,9 @@ permissions:
157160
# This permission allows the player to bypass the dimensional teleportation
158161
# Default: zhomes.bypass.dimensionalteleportation
159162
dimensional-teleportation: "zhomes.bypass.dimensionalteleportation" # Only OP by default
163+
# Allow player's to bypass safe teleportation
164+
# Default: zhomes.bypass.safeteleport
165+
safe-teleportation: "zhomes.bypass.safeteleport" # False by default
160166
# This permission allows the player to bypass the teleportation warmup
161167
# Default: zhomes.bypass.warmup
162168
warmup: "zhomes.bypass.warmup" # Only OP by default

0 commit comments

Comments
 (0)