Skip to content

Commit

Permalink
RegistryParser - strip out minecraft namespaces from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Jul 1, 2024
1 parent e8c8b5f commit 6dba25d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ public String toVariableNameString(final ItemStack i) {
Classes.registerClass(biomeClassInfo
.user("biomes?")
.name("Biome")
.description("All possible biomes Minecraft uses to generate a world.")
.description("All possible biomes Minecraft uses to generate a world.",
"NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'.")
.examples("biome at the player is desert")
.since("1.4.4")
.after("damagecause"));
Expand Down Expand Up @@ -1463,7 +1464,8 @@ public String toVariableNameString(FireworkEffect effect) {
Classes.registerClass(catTypeClassInfo
.user("cat ?(type|race)s?")
.name("Cat Type")
.description("Represents the race/type of a cat entity.")
.description("Represents the race/type of a cat entity.",
"NOTE: Minecraft namespaces are supported, ex: 'minecraft:british_shorthair'.")
.since("2.4")
.requiredPlugins("Minecraft 1.14 or newer")
.documentationId("CatType"));
Expand Down Expand Up @@ -1531,7 +1533,8 @@ public String toVariableNameString(EnchantmentOffer eo) {
.user("attribute ?types?")
.name("Attribute Type")
.description("Represents the type of an attribute. Note that this type does not contain any numerical values."
+ "See <a href='https://minecraft.wiki/w/Attribute#Attributes'>attribute types</a> for more info.")
+ "See <a href='https://minecraft.wiki/w/Attribute#Attributes'>attribute types</a> for more info.",
"NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.")
.since("2.5"));

Classes.registerClass(new EnumClassInfo<>(Environment.class, "environment", "environments")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -147,8 +145,7 @@ private void refresh() {
* Note that some entries may represent the same registry object.
*/
public String getAllNames() {
List<String> strings = new ArrayList<>(parseMap.keySet());
Collections.sort(strings);
List<String> strings = parseMap.keySet().stream().filter(s -> !s.startsWith("minecraft:")).sorted().toList();
return StringUtils.join(strings, ", ");
}

Expand Down

0 comments on commit 6dba25d

Please sign in to comment.