mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Merge branch 'v6' into features/v6/queue-features
This commit is contained in:
@ -16,7 +16,7 @@ dependencies {
|
||||
implementation("org.khelekore:prtree:1.7.0-SNAPSHOT")
|
||||
// Adventure related stuff
|
||||
implementation('net.kyori:adventure-api:4.0.0-SNAPSHOT')
|
||||
implementation('net.kyori:adventure-text-minimessage:3.0.0-SNAPSHOT')
|
||||
implementation('net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT')
|
||||
compile("com.google.inject:guice:4.2.3")
|
||||
compile("com.google.inject.extensions:guice-assistedinject:4.2.3")
|
||||
compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
|
||||
@ -82,7 +82,7 @@ shadowJar {
|
||||
include(dependency('net.kyori:adventure-gson:4.0.0-SNAPSHOT'))
|
||||
include(dependency('net.kyori:adventure-legacy:4.0.0-SNAPSHOT'))
|
||||
include(dependency('net.kyori:adventure-plain:4.0.0-SNAPSHOT'))
|
||||
include(dependency('net.kyori:adventure-text-minimessage:3.0.0-SNAPSHOT'))
|
||||
include(dependency('net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT'))
|
||||
include(dependency('org.khelekore:prtree:1.7.0-SNAPSHOT'))
|
||||
}
|
||||
relocate('net.kyori.text', 'com.plotsquared.formatting.text')
|
||||
|
@ -113,7 +113,7 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-minimessage</artifactId>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -28,6 +28,7 @@ package com.plotsquared.core.command;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
@ -149,6 +150,11 @@ public class Alias extends SubCommand {
|
||||
player.sendMessage(TranslatableCaption.of("alias.alias_is_taken"));
|
||||
return;
|
||||
}
|
||||
if (Settings.UUID.OFFLINE) {
|
||||
plot.setAlias(alias);
|
||||
player.sendMessage(TranslatableCaption.of("alias.alias_set_to"), Template.of("alias", alias));
|
||||
return;
|
||||
}
|
||||
PlotSquared.get().getImpromptuUUIDPipeline().getSingle(alias, ((uuid, throwable) -> {
|
||||
if (throwable instanceof TimeoutException) {
|
||||
player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout"));
|
||||
|
@ -118,6 +118,7 @@ public class HomeCommand extends Command {
|
||||
PlotQuery query = query(player);
|
||||
int page = 1; // page = index + 1
|
||||
String identifier;
|
||||
PlotArea plotArea;
|
||||
boolean basePlotOnly = true;
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
@ -143,12 +144,18 @@ public class HomeCommand extends Command {
|
||||
query.withPlot(fromId);
|
||||
break;
|
||||
}
|
||||
// allow for plot home within a plot area
|
||||
plotArea = this.plotAreaManager.getPlotAreaByString(args[0]);
|
||||
if (plotArea != null) {
|
||||
query.inArea(plotArea);
|
||||
break;
|
||||
}
|
||||
// it wasn't a valid plot id, trying to find plot by alias
|
||||
query.withAlias(identifier);
|
||||
break;
|
||||
case 2:
|
||||
// we assume args[0] is a plot area and args[1] an identifier
|
||||
final PlotArea plotArea = this.plotAreaManager.getPlotAreaByString(args[0]);
|
||||
plotArea = this.plotAreaManager.getPlotAreaByString(args[0]);
|
||||
identifier = args[1];
|
||||
if (plotArea == null) {
|
||||
// invalid command, therefore no plots
|
||||
|
@ -168,7 +168,7 @@ public class PlotListener {
|
||||
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
|
||||
for (UUID uuid : plot.getOwners()) {
|
||||
final PlotPlayer owner = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid);
|
||||
if (owner != null && !owner.getUUID().equals(player.getUUID())) {
|
||||
if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("notification.notify_enter"),
|
||||
Template.of("player", player.getName()),
|
||||
@ -355,7 +355,7 @@ public class PlotListener {
|
||||
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
|
||||
for (UUID uuid : plot.getOwners()) {
|
||||
final PlotPlayer owner = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid);
|
||||
if ((owner != null) && !owner.getUUID().equals(player.getUUID())) {
|
||||
if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("notification.notify_leave"),
|
||||
Template.of("player", player.getName()),
|
||||
|
@ -218,4 +218,8 @@ public class ConsolePlayer extends PlotPlayer<Actor> {
|
||||
return PlotSquared.platform().getConsoleAudience();
|
||||
}
|
||||
|
||||
@Override public boolean canSee(final PlotPlayer<?> other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -859,6 +859,16 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
||||
return this.metaMap.containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player is able to see the other player.
|
||||
* This does not mean that the other player is in line of sight of the player,
|
||||
* but rather that the player is permitted to see the other player.
|
||||
*
|
||||
* @param other Other player
|
||||
* @return {@code true} if the player is able to see the other player, {@code false} if not
|
||||
*/
|
||||
public abstract boolean canSee(PlotPlayer<?> other);
|
||||
|
||||
public abstract void stopSpectating();
|
||||
|
||||
public boolean hasDebugMode() {
|
||||
|
@ -50,6 +50,7 @@ public class BlockTypeWrapper {
|
||||
private static final Map<BlockType, BlockTypeWrapper> blockTypes = new HashMap<>();
|
||||
private static final Map<String, BlockTypeWrapper> blockCategories = new HashMap<>();
|
||||
@Nullable private final BlockType blockType;
|
||||
private static final String minecraftNamespace = "minecraft";
|
||||
@Nullable private final String blockCategoryId;
|
||||
@Nullable private BlockCategory blockCategory;
|
||||
|
||||
@ -81,7 +82,14 @@ public class BlockTypeWrapper {
|
||||
}
|
||||
|
||||
public static BlockTypeWrapper get(final String blockCategoryId) {
|
||||
return blockCategories.computeIfAbsent(blockCategoryId, BlockTypeWrapper::new);
|
||||
// use minecraft as default namespace
|
||||
String id;
|
||||
if (blockCategoryId.indexOf(':') == -1) {
|
||||
id = minecraftNamespace + ":" + blockCategoryId;
|
||||
} else {
|
||||
id = blockCategoryId;
|
||||
}
|
||||
return blockCategories.computeIfAbsent(id, BlockTypeWrapper::new);
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
|
Reference in New Issue
Block a user