-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: - Added bStats. - Added a config option "disable-group-teleporting" that prevents all players standing on a beacon from teleporting at the same time when it was activated, and instead only teleports the player choosing the destination, when enabled. - Added config reload command (/waypoints reload). This adds the permission BeaconWaypoints.reload which is enabled for operators by default. - Changed the icon for the "Options for this waypoint" button from a comparator to the icon of the waypoint being interacted with. - Added an update checker that notifies the console and operators of an update to the plugin. Bug Fixes: - A waypoint was not deleted if the beacon was removed with the setblock or fill commands. Changing or deleting blocks using WorldEdit still does not remove the waypoint. - BeaconWaypoints could conflict with other plugins and make players take fall damage when landing on the destination beacon.
- Loading branch information
BuildTools
committed
Feb 21, 2022
1 parent
b732e2a
commit 5596cf3
Showing
18 changed files
with
210 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Changes: | ||
- Added bStats. | ||
- Added a config option "disable-group-teleporting" that prevents all players standing on a beacon from teleporting at the same time when it was activated, and instead only teleports the player choosing the destination, when enabled. | ||
- Added config reload command (/waypoints reload). This adds the permission BeaconWaypoints.reload which is enabled for operators by default. | ||
- Changed the icon for the "Options for this waypoint" button from a comparator to the icon of the waypoint being interacted with. | ||
- Added an update checker that notifies the console and operators of an update to the plugin. | ||
|
||
Bug Fixes: | ||
- A waypoint was not deleted if the beacon was removed with the setblock or fill commands. Changing or deleting blocks using WorldEdit still does not remove the waypoint. | ||
- BeaconWaypoints could conflict with other plugins and make players take fall damage when landing on the destination beacon. |
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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/github/dawsonvilamaa/beaconwaypoint/UpdateChecker.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,31 @@ | ||
package com.github.dawsonvilamaa.beaconwaypoint; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import org.bukkit.util.Consumer; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.net.URL; | ||
import java.util.Scanner; | ||
|
||
public class UpdateChecker { | ||
private final JavaPlugin plugin; | ||
private final int resourceId; | ||
|
||
public UpdateChecker(JavaPlugin plugin, int resourceId) { | ||
this.plugin = plugin; | ||
this.resourceId = resourceId; | ||
} | ||
|
||
public void getVersion(final Consumer<String> consumer) { | ||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> { | ||
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream(); Scanner scanner = new Scanner(inputStream)) { | ||
if (scanner.hasNext()) | ||
consumer.accept(scanner.next()); | ||
} catch (IOException exception) { | ||
plugin.getLogger().info("Unable to check for updates: " + exception.getMessage()); | ||
} | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- delete waypoint if beacon is removed via command rather than manually breaking (done but doesn't work for worldedit) | ||
- add config option to change whether beacon teleports all entities standing on it or just that player (done) | ||
- add bStats (done) | ||
- disable player fall damage when falling on destination beacon (event) (done) | ||
- plugin reload command (/waypoint reload) (done) | ||
- change current beacon settings button to waypoint's icon (done) | ||
- add update notification for console and when op joins the server (done) |
Oops, something went wrong.