Skip to content

Commit

Permalink
Fixed error reported from p0ns.
Browse files Browse the repository at this point in the history
Fixer error encountered when DURATION < 1.
  • Loading branch information
Fulminazzo committed Oct 16, 2023
1 parent a954b62 commit 18b664f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>it.fulminazzo</groupId>
<artifactId>TeleportEffects</artifactId>
<version>2.0</version>
<version>2.1</version>
<packaging>jar</packaging>

<name>TeleportEffects</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event) {
if (event.isCancelled()) return;
Location teleportLocation = event.getTo();
if (teleportLocation == null) return;
if (ConfigOption.DURATION.getInt() < 1) return;
if (ConfigOption.WHITELISTED_TELEPORT_CAUSES.getTeleportCauses().contains(event.getCause())) return;
Player player = event.getPlayer();
if (player.hasPermission(TeleportPermission.BYPASS.getPermission())) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public TeleportEffects(Class<?> playersManager, Class<Player> playersClass) {

@Override
public void onEnable() {
if (this.getClass().equals(TeleportEffects.class)) plugin = this;
plugin = this;
setPlayerManagerClass(playersManager, playersClass);
super.onEnable();
if (isEnabled()) {
Expand Down

0 comments on commit 18b664f

Please sign in to comment.