-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Integration with DutchyTPA and DutchyHome - If DutchyTPA is installed, it will listen to its dedicated event, instead of /tpa - if DutchyHome is installed, it will listen to its dedicated event, instead of /home REQUIRES DutchyTPA 1.1.0 and DutchyHome 1.1.0 TO WORK!
- Loading branch information
TheDutchMC
committed
Jul 1, 2020
1 parent
efc5617
commit 14b1b14
Showing
6 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/nl/thedutchmc/dutchyback/listeners/SuccesfulHomeTeleportEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package nl.thedutchmc.dutchyback.listeners; | ||
|
||
import java.util.UUID; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
import nl.thedutchmc.dutchyback.Back; | ||
import nl.thedutchmc.dutchyhome.SuccessfulHomeTeleportEvent; | ||
|
||
public class SuccesfulHomeTeleportEventListener implements Listener { | ||
|
||
@EventHandler | ||
public void onSuccesfulTpaEvent(SuccessfulHomeTeleportEvent event) { | ||
|
||
|
||
Location loc = event.getLocationBeforeHomeTp(); | ||
UUID uuid = event.getPlayer().getUniqueId(); | ||
|
||
if(Back.playerBackLocs.containsKey(uuid)) { | ||
Back.playerBackLocs.replace(uuid, loc); | ||
} else { | ||
Back.playerBackLocs.put(uuid, loc); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/nl/thedutchmc/dutchyback/listeners/SuccessfulTpaEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package nl.thedutchmc.dutchyback.listeners; | ||
|
||
import java.util.UUID; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
import nl.thedutchmc.dutchyback.Back; | ||
import nl.thedutchmc.dutchytpa.SuccessfulTpaEvent; | ||
|
||
public class SuccessfulTpaEventListener implements Listener { | ||
|
||
@EventHandler | ||
public void onSuccessfulTpaEvent(SuccessfulTpaEvent event) { | ||
|
||
Location loc = event.getLocationBeforeTpa(); | ||
UUID uuid = event.getPlayer().getUniqueId(); | ||
|
||
if(Back.playerBackLocs.containsKey(uuid)) { | ||
Back.playerBackLocs.replace(uuid, loc); | ||
} else { | ||
Back.playerBackLocs.put(uuid, loc); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
name: DutchyBack | ||
main: nl.thedutchmc.dutchyback.Back | ||
version: 1.0.0 | ||
version: 1.0.1 | ||
api-version: 1.16 | ||
author: TheDutchMC | ||
description: A plugin which adds /back | ||
softdepend: [DutchyTPA, DutchyHome] | ||
commands: | ||
back: | ||
description: Go to your previous location |