mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 00:55:45 +00:00
location command fix when UseLocationsInSameWorld is enabled
locations can be used in another world with bypass perm when UseLocationsInSameWorld is enabled
This commit is contained in:
parent
1e903e447b
commit
671d422683
@ -125,5 +125,11 @@
|
||||
<version>1.18.22</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>19.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.6.8-4</version>
|
||||
<version>3.6.8-3-DEVBUILD</version>
|
||||
|
||||
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
||||
|
||||
|
@ -89,11 +89,13 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
||||
HashMap<String, RTPWorld> locations = new HashMap<>();
|
||||
boolean needPermission = BetterRTP.getInstance().getSettings().isLocationNeedPermission();
|
||||
boolean needSameWorld = BetterRTP.getInstance().getSettings().isUseLocationsInSameWorld();
|
||||
if (needSameWorld)
|
||||
needSameWorld = !PermissionNode.BYPASS_LOCATION.check(sendi);
|
||||
for (Map.Entry<String, RTPWorld> location : BetterRTP.getInstance().getRTP().getRTPworldLocations().entrySet()) {
|
||||
boolean add = true;
|
||||
if (needPermission) //Do we need permission to go to this location?
|
||||
add = PermissionCheck.getLocation(sendi, location.getKey());
|
||||
if (add && needSameWorld) //Can be added and needs same world (if not same world, we don't care to check)
|
||||
if (add && needSameWorld) //Can be added and needs same world (if not same world, we don't check)
|
||||
add = world == null || location.getValue().getWorld().equals(world);
|
||||
if (add) //Location can be added to list
|
||||
locations.put(location.getKey(), location.getValue());
|
||||
|
@ -16,6 +16,7 @@ public enum PermissionNode implements PermissionCheck {
|
||||
BYPASS_HUNGER("bypass.hunger"),
|
||||
BYPASS_COOLDOWN("bypass.cooldown"),
|
||||
BYPASS_DELAY("bypass.delay"),
|
||||
BYPASS_LOCATION("bypass.location"), //Ability to bypass `UseLocationsInSameWorld` if enabled in location.yml
|
||||
RELOAD("reload"),
|
||||
SETTINGS("settings"),
|
||||
INFO("info"),
|
||||
|
@ -61,7 +61,7 @@ Settings:
|
||||
DisableUpdater: false
|
||||
Logger:
|
||||
Enabled: true #Log all things rtp related to the log.log file
|
||||
LogToConsole: true
|
||||
LogToConsole: false
|
||||
Format: 'yyyy-MM-dd HH:mm:ss'
|
||||
|
||||
Default:
|
||||
|
@ -14,6 +14,7 @@ Enabled: false #enable the locations feature
|
||||
RequirePermission: false #Require players to have `betterrtp.location.<world_name>`
|
||||
UseLocationIfAvailable: true #Will choose a location upon `/rtp` if location(s) is available in the world
|
||||
UseLocationsInSameWorld: true #Will only choose locations in same world rtp'ing in
|
||||
# If UseLocationsInSameWorld is set to true, use `betterrtp.bypass.location` to allow rtp'ing to locations in other worlds
|
||||
|
||||
Locations:
|
||||
- main_loc:
|
||||
|
Loading…
x
Reference in New Issue
Block a user