mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-04-17 01:26:08 +02:00
Add TP button to /rg list where applicable.
This commit is contained in:
parent
b757fcc88b
commit
aa8997aeca
@ -33,6 +33,7 @@
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
import com.sk89q.worldguard.internal.permission.RegionPermissionModel;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
@ -260,6 +261,12 @@ public Component getComponent(int number) {
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND,
|
||||
"/rg info -w " + world + " " + entry.region.getId()))));
|
||||
}
|
||||
if (perms != null && entry.region.getFlag(Flags.TELE_LOC) != null && perms.mayTeleportTo(entry.region)) {
|
||||
builder.append(TextComponent.space().append(TextComponent.of("[TP]", TextColor.GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click for teleport")))
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND,
|
||||
"/rg tp -w " + world + " " + entry.region.getId()))));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user