Minor upstream merge

This commit is contained in:
NotMyFault
2021-02-03 23:08:39 +01:00
parent c1f6e43763
commit ac16c9a2ba
14 changed files with 87 additions and 6 deletions

View File

@ -21,6 +21,8 @@ package com.sk89q.worldedit.extension.platform;
import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.internal.util.NonAbstractForCompatibility;
import com.sk89q.worldedit.registry.Keyed;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.io.ResourceLoader;
import com.sk89q.worldedit.world.DataFixer;
@ -29,6 +31,7 @@ import com.sk89q.worldedit.world.registry.Registries;
import org.enginehub.piston.CommandManager;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
@ -39,7 +42,7 @@ import javax.annotation.Nullable;
* <p>It is strongly recommended that implementations extend from
* {@link AbstractPlatform}.</p>
*/
public interface Platform {
public interface Platform extends Keyed {
/**
* Return the resource loader.
@ -176,6 +179,18 @@ public interface Platform {
*/
String getPlatformVersion();
/**
* {@inheritDoc}
* @return an id
* @apiNote This must be overridden by new subclasses. See {@link NonAbstractForCompatibility}
* for details
*/
@NonAbstractForCompatibility(delegateName = "getPlatformName", delegateParams = {})
@Override
default String getId() {
return "legacy:" + getPlatformName().toLowerCase(Locale.ROOT).replaceAll("[^a-z_.-]", "_");
}
/**
* Get a map of advertised capabilities of this platform, where each key
* in the given map is a supported capability and the respective value