Add and apply .editorconfig from P2 (#1195)

* Consistenty use javax annotations.
 - Unfortunately jetbrains annotations seem to be exposed transitively via core somewhere, but with the correct IDE settings, annotations can be defaulted to javax
 - Cleaning up of import order in #1195
 - Must be merged before #1195

* Add and apply .editorconfig from P2
 - Does not rearrange entries

* Address some comments

* add back some javadoc comments

* Address final comments

Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
dordsor21
2021-07-24 16:34:05 +01:00
committed by GitHub
parent 3b4beba7d6
commit 8c0195970b
1143 changed files with 143599 additions and 9952 deletions

View File

@ -75,14 +75,16 @@ public class BiomeCommands {
}
@Command(
name = "biomelist",
aliases = { "biomels", "/biomelist", "/listbiomes" },
desc = "Gets all biomes available."
name = "biomelist",
aliases = {"biomels", "/biomelist", "/listbiomes"},
desc = "Gets all biomes available."
)
@CommandPermissions("worldedit.biome.list")
public void biomeList(Actor actor,
@ArgFlag(name = 'p', desc = "Page number.", def = "1")
int page) {
public void biomeList(
Actor actor,
@ArgFlag(name = 'p', desc = "Page number.", def = "1")
int page
) {
WorldEditAsyncCommandBuilder.createAndSendMessage(actor, () -> {
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
@ -90,27 +92,30 @@ public class BiomeCommands {
PaginationBox paginationBox = PaginationBox.fromComponents("Available Biomes", "/biomelist -p %page%",
BiomeType.REGISTRY.values().stream()
.map(biomeType -> TextComponent.builder()
.append(biomeType.getId())
.append(" (")
.append(biomeRegistry.getRichName(biomeType))
.append(")")
.build())
.collect(Collectors.toList()));
return paginationBox.create(page);
.append(biomeType.getId())
.append(" (")
.append(biomeRegistry.getRichName(biomeType))
.append(")")
.build())
.collect(Collectors.toList())
);
return paginationBox.create(page);
}, (Component) null);
}
@Command(
name = "biomeinfo",
desc = "Get the biome of the targeted block.",
descFooter = "By default, uses all blocks in your selection."
name = "biomeinfo",
desc = "Get the biome of the targeted block.",
descFooter = "By default, uses all blocks in your selection."
)
@CommandPermissions("worldedit.biome.info")
public void biomeInfo(Player player, LocalSession session,
@Switch(name = 't', desc = "Use the block you are looking at.")
boolean useLineOfSight,
@Switch(name = 'p', desc = "Use the block you are currently in.")
boolean usePosition) throws WorldEditException {
public void biomeInfo(
Player player, LocalSession session,
@Switch(name = 't', desc = "Use the block you are looking at.")
boolean useLineOfSight,
@Switch(name = 'p', desc = "Use the block you are currently in.")
boolean usePosition
) throws WorldEditException {
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
Set<BiomeType> biomes = new HashSet<>();
@ -144,24 +149,26 @@ public class BiomeCommands {
}
List<Component> components = biomes.stream().map(biome ->
biomeRegistry.getRichName(biome).hoverEvent(
HoverEvent.showText(TextComponent.of(biome.getId()))
)
biomeRegistry.getRichName(biome).hoverEvent(
HoverEvent.showText(TextComponent.of(biome.getId()))
)
).collect(Collectors.toList());
player.print(Caption.of(messageKey, TextUtils.join(components, TextComponent.of(", "))));
}
@Command(
name = "/setbiome",
desc = "Sets the biome of your current block or region.",
descFooter = "By default, uses all the blocks in your selection"
name = "/setbiome",
desc = "Sets the biome of your current block or region.",
descFooter = "By default, uses all the blocks in your selection"
)
@Logging(REGION)
@CommandPermissions("worldedit.biome.set")
public void setBiome(Player player, LocalSession session, EditSession editSession,
@Arg(desc = "Biome type.") BiomeType target,
@Switch(name = 'p', desc = "Use your current position")
boolean atPosition) throws WorldEditException {
public void setBiome(
Player player, LocalSession session, EditSession editSession,
@Arg(desc = "Biome type.") BiomeType target,
@Switch(name = 'p', desc = "Use your current position")
boolean atPosition
) throws WorldEditException {
World world = player.getWorld();
Region region;
Mask mask = editSession.getMask();