Releases: CryptoMorin/XSeries
v12.1.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>12.1.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:12.1.0")
}Important
Don't forget to shade the library.
1.21.4 Support
Important
XSeries will no longer follow independent class principle due to a lot of changes caused by previous versions.
This version implements the abstraction concept from #239 as an experiment. This change was forced because
Minecraft now uses registries for most enum-like.
- Added v1.21.4 support thanks to @kangarko
- Implemented the @XMergeannotation system.
- Added license header for all classes.
- Added XItemFlag.
- Added XPatternType.
- Fixed XMaterial.BLACK_DYE for v1.8
- Fixed an error caused by XSound in older versions (issue with pulling system values)
- Fixed an issue with XPotion name matching system.
- MethodMemberHandles are now more lenient when it comes to public methods that are in superclasses of the target class.
- Added XTag.getTag(String name)
- XTag general class cleanup (Uses TagBuilder, we should also inline most tags)
- Deprecated a lot of methods. Although they wont be removed any time soon, you should update as soon as possible.
- Fixed XItemStack to use XPatternType.
- XPotion now covers more value ranges.
- Significantly improved unit tests.
- Fixed a few broken sound entries for v1.12
- Improved XEnchantment's Enchantment->XEnchantment mapping for older versions.
- XAttribute: Fixed some missing values. Also fixed the entire class for some older versions (specifically ~v1.15-1.19)
- XParticle: Fixed some missing/mismatched values.
v12.0.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>12.0.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:12.0.0")
}Important
Don't forget to shade the library.
v1.21.3 Support - Registry Update
Important
XSeries will no longer follow independent class principle due to a lot of changes caused by previous versions.
This version implements the abstraction concept from #239 as an experiment. This change was forced because
Minecraft now uses registries for most enum-like.
This version introduces the new XRegistry/XModule system which is going to be inherited for XEnchantment, XPotion, XEntityType and XMaterial in later versions if this goes well.
- Added XAttribute.
- Fixed XSound & XBiome support for v1.21.3
- Fixed XTag.ORES not including diamonds and emeralds
- Fixed XItemStack support for v1.8.8
v11.3.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.3.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.3.0")
}Important
Don't forget to shade the library.
- Replaced all JavaX annotations with JetBrains annotations.
- Added more annotations to XSkull APIs.
- Fixed some errors with XSkull API (specially when used for XItemStack) (Fixes #300)
- Added AggregateReflectiveSupplier
- Added more tests.
- XSkull will now try to create less verbose profile values which can be used for XItemStack but requires extra settings.
v11.2.2
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.2.2</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.2.2")
}Important
Don't forget to shade the library.
v11.2.1
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.2.1</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.2.1")
}Important
Don't forget to shade the library.
- Added v1.21 support.
- Added Object and CharSequence as predefined classes for ReflectionParser.
- ReflectionParser class declarations now support simple generics.
- XSkull will now more lenient with proxy reflection errors.
- Fixed particle deserialization from conkfig when no particle size is specified for dust particles.
- XReflection parameter and return types are now lazy.
v11.2.0.1
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.2.0.1</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.2.0.1")
}Important
Don't forget to shade the library.
- XItemStack#parseColor now accepts hex colors
- XSkull Profileables are now nullable for certain types.
- Fixed XSkull proxy reflection issues on v1.18.1-1.19.4
- Removed all usage of the old XReflection within XSeries code.
- Fixed a few issues with NMSExtras.
- Due to people reporting "NMS_VERSION" from getVersionInformation() returning null, it was changed to "Unknown NMS" instead.
- Fixed an issue where trying to reflect a class handle with no names provided didn't provide a proper error.
- Added more Javadocs.
v11.2.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.2.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.2.0")
}Important
Don't forget to shade the library.
- Fixed a lot of issues with XSkull
- Added more documentations to XReflectionwith a few renames and bug fixes.
- Added enum support for XReflection.
- Changed the default material for XItemStack.
v11.1.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.1.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.1.0") { isTransitive = false }
}Important
Don't forget to shade the library.
v1.21 Support
XSkull
- Moved to another package. Classes have been split.
- Made non-API methods private inside XSkull.
- Fixed UUID detection as string values.
- Fixed a few issues with offline/online UUID profiles and their cachex.
- Added a lenient() and fallback() method to XSkull.
- Allows HTTPS requests for texture links.
XReflection
- Added more predefined classes to ReflectionParser.
- Added inner class support to XReflection
Others
- The of(String) method of XParticle&XEntityTypenow return Optional.
v11.0.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>11.0.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:11.0.0") { isTransitive = false }
}Important
Don't forget to shade the library.
Quick Code Update
I'm very sorry for the class renames. It had to be done at some point.
You could simply do a RegEx replace in this order (unfortunately IntelliJ's Migrate feature doesn't work for nonexisting
classes properly):
- ReflectionUtils
- Replace import (static )?com.cryptomorin.xseries.ReflectionUtils
 withimport $1com.cryptomorin.xseries.reflection.XReflection
- Replace ReflectionUtilswithXReflection
- Replace (XReflection.)?sendPacket(Sync)?\(withMinecraftConnection.sendPacket(
- For people who want to use the new ClassHandle API:
- (?:XReflection\.)?getNMSClass\(([\w."]+), ([\w"]+)\)->- XReflection.ofMinecraft().inPackage(MinecraftPackage.NMS, $1).named($2).unreflect()
- (?:XReflection\.)?getCraftClass\("(?:([\w\.]+)(?:\.))?(\w+)"\)->- XReflection.ofMinecraft().inPackage(MinecraftPackage.CB, "$1").named("$2").unreflect()
 
 
- Replace 
- NMSExtras
- Replace import (static )?com.cryptomorin.xseries.NMSExtras
 withimport $1com.cryptomorin.xseries.reflection.minecraft.NMSExtras
 
- Replace 
- SkullUtils
- Replace SkullUtilswithXSkull
- Replace XSkull.applySkin\(([^,]+), ([\w\d_]+)\)withXSkull.of($1).profile($2).apply()
 
- Replace 
You may have to update some parts manually yourself after this replacement.
XReflection (Former ReflectionUtils)
Completely revamped. ReflectionUtils has been split into so many classes. While I understand this might upset some
people because
they now have to include an entire package for ReflectionUtils-dependent classes to work, the class was becoming
almost unmaintainable from all the clutter. Most of these new features are experimental and might change in the future.
- Now has a functional API.
- Added string-based reflection which works specially well in IntelliJ because of the syntax highlighting support. The
 performance of this approach is obviously much worse, but since this should only be done once (even if you're using
 the functional approach, you should cache all reflection calls), the readability advantages far outweigh the
 performance disadvantage.
void functionalAPI() {
    MinecraftClassHandle CraftMetaSkull = XReflection.ofMinecraft()
            .inPackage(MinecraftPackage.CB, "inventory")
            .named("CraftMetaSkull");
    MethodHandle profileGetterMeta = CraftMetaSkull.getterField()
            .named("profile")
            .returns(GameProfile.class)
            .makeAccessible()
            .reflect();
}
void stringAPI() {
    // Normally all classes you pass to a namespace are visible 
    // (classes created from XReflection handle methods or passed to parameter(), return(), etc methods)
    // But sometimes the only way to make these classes visible would be to import them manually here.
    // You can avoid doing this and use fully qualified names instead inside strings.
    ReflectiveNamespace ns = XReflection.namespaced().imports(GameProfile.class);
    // There are shorthand names for packages like "nms", "spigot" and "cb"
    // The "extends CraftMetaItem implements SkullMeta" is completely useless and
    // only included for brevity (doesn't affect anything if the found class doesn't implement the specified classes).
    MinecraftClassHandle CraftMetaSkull = ns.ofMinecraft(
            // This code will be highlighted when used in IntelliJ:
            "package cb.inventory; class CraftMetaSkull extends CraftMetaItem implements SkullMeta {}"
    );
    MethodHandle profileGetterMeta = CraftMetaSkull.field("private GameProfile profile;")
            .map(MinecraftMapping.OBFUSCATED, "a") // You can mix functional and string APIs
            .getter().reflect();
}XSkull (Former SkullUtils)
XSkull was completely revamped, all thanks to @Condordito
- It now supports offline mode servers and has a more robust API.
- Fixed some issues with detecting the correct skin value passed.
XBlock
- Removed deprecated methods from XBlock.
- Fixed an issue with setting skulls using XBlock.setType()
Others
- Fixed Data.NAME_MAPPINGforXParticleandXEntityType.
- Fixed a bug with ParticleDisplayon older versions.
- Fixed legacy support for XPotion.
- Fixed an issue with XWorldBorderin outdated servers.
- Fixed withLocationCaller()forParticlesclass.
- Removed the deprecated XMaterial.isOneOf()andXMaterial.matchXMaterial(int id, byte data)
- Fixed a lot of issues in XParticlethanks to @CJCrafter
v10.0.0
Maven
<dependency>
    <groupId>com.github.cryptomorin</groupId>
    <artifactId>XSeries</artifactId>
    <version>10.0.0</version>
</dependency>Gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.github.cryptomorin:XSeries:10.0.0") { isTransitive = false }
}Important
Don't forget to shade the library.
- Added v1.20.6 (and v1.20.5?) support.
- Added XEntityType
- Added XParticle
- Renamed XParticle to Particles
- Added Experimental API to ReflectionUtils