Upstream changes (#717)

* Perform part of the move of //fast to //perf (#1377)

This re-adds a deprecated `//fast` and moves the current logic to
`//perf`. Later `//perf` will have its syntax reworked, when Piston
finally supports sub-commands properly!

* Names via Translation (#1268)

* Deprecate BiomeRegistry, etc.

* Update some libraries, e.g. text

* Move to new translation renderer

* Revert "Deprecate BiomeRegistry, etc."

This reverts commit 59a5d6c92aec52739a8dc68ac3d23898af7593dd.

This was not a good idea for potential mod shenanigans.

* Move BiomeData#getName to BiomeRegistry, use i18n

* Use getRichName instead of getName

* Implement getRichName for NullBiomeRegistry

* Add getRichName for blocks

* Relocate net.kyori.minecraft

* Update adapters for getRichBlockName

* Add getRichName for items

* Update adapters for getRichItemName

* Update adapters JAR for merge

(cherry picked from commit cfd26253b6fb59ff6c65a0157a6780be7db4ea5a)

* Follow-up fixes for 92f877679622a27b16b9e5cd61cfec1a6545be33

* Don't send deprecation warning and improve info message

* Fix click command for perf box

(cherry picked from commit 7ee60060c31df2f8b41212b430a0875312189339)

* update R3 adapter§

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com>
Co-authored-by: Aurora <aurora@relanet.eu>
This commit is contained in:
Hannes Greule
2020-11-09 10:38:10 +01:00
committed by GitHub
parent 49052d73ce
commit 428f8e201d
42 changed files with 660 additions and 303 deletions

View File

@ -19,6 +19,9 @@
package com.sk89q.worldedit.sponge;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.translation.TranslationManager;
import com.sk89q.worldedit.world.biome.BiomeData;
import com.sk89q.worldedit.world.registry.BiomeRegistry;
import org.spongepowered.api.world.biome.BiomeType;
@ -30,12 +33,21 @@ import javax.annotation.Nullable;
*/
class SpongeBiomeRegistry implements BiomeRegistry {
@Override
public Component getRichName(com.sk89q.worldedit.world.biome.BiomeType biomeType) {
return TranslatableComponent.of(
TranslationManager.makeTranslationKey("biome", biomeType.getId())
);
}
@Deprecated
@Nullable
@Override
public BiomeData getData(com.sk89q.worldedit.world.biome.BiomeType biome) {
return new SpongeBiomeData(SpongeAdapter.adapt(biome));
}
@Deprecated
private static class SpongeBiomeData implements BiomeData {
private final BiomeType biome;
@ -48,6 +60,7 @@ class SpongeBiomeRegistry implements BiomeRegistry {
this.biome = biome;
}
@SuppressWarnings("deprecation")
@Override
public String getName() {
return biome.getName();