Releases: CryptoMorin/XSeries
v13.2.0
Maven
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>13.2.0</version>
</dependency>
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.cryptomorin:XSeries:13.2.0")
}
Important
Don't forget to set api-version: 1.13
in your plugins.yml.
Don't forget to shade the library.
Added v1.21.5 support.
XRegistry
- Added a way to get registries of modules by their class.
XInventoryView & XArt
- Fixed errors on older versions when equals()/hashcode()/toString() are called.
XItemStack
- Revamped the serialization system to use a cleaner item meta chaining system instead of the current YanDev if-else chain.
- Fixed an issue with armor trims not being properly deserialized.
- Improved Unit Tests.
XWorldBorder
- Now uses the native Bukkit API when possible.
XItemFlag
- Renamed
hideEverything(ItemMeta)
todecorationOnly(ItemMeta)
due to the new v1.21.5 new flags.
v13.1.0
Maven
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>13.1.0</version>
</dependency>
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.cryptomorin:XSeries:13.1.0")
}
Important
Don't forget to shade the library.
Maven Aggregate Project
This project has been converted into an aggregator Maven project with
submodules. This change was necessary to implement the new API classes
mentioned below.
XInventoryView & XArt
Introducing XInventoryView.of(InventoryView) & XArt.of(Art) which allows you to use Bukkit's InventoryView
and Art
classes respectively in a cross-version compatible way. Bukkit changed their API from abstract/enum classes to
interfaces for these classes. Although this might not appear to cause any issues at first, plugins compiled for
non-interface vs interface have a different underlying bytecode which can cause runtime errors depending on which
version the plugin was compiled against. These two classes add a minimal zero-overhead wrapper that handles this issue.
XItemStack
- Fixed ItemFlags for v1.20.6+
addItems()
now uses item-specific stack size checking instead of inventory-based stack size by default.
XBlock
- Fixed
setColor()
for 1.13+
XSkull
- Attempted a fix for hybrid server softwares like Arclight Forge.
v13.0.0
Maven
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>13.0.0</version>
</dependency>
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.cryptomorin:XSeries:13.0.0")
}
Important
Don't forget to shade the library.
Happy new year!
Important
XReflection
About
For the past few months I've been working on XReflection extensively. XReflection first started as a small group of classes
that's designed for Minecraft in mind specifically. It makes other classes that require reflection much easier.
However, I've been improving it a lot that simplifies this process, each simplification is in a stage. There are a total of
five stages and currently 4 of them are implemented. All these steps were mostly a proof-of-concept for the 5th and final stage.
This final stage allows developers to seamlessly use NMS/CraftBukkit classes across multiple versions, using real constructors, fields and methods, whether private, protected or public, with compile-time checked types and almost zero overhead.
Future Plans
XSeries packaged JAR is currently 700kb and 200kb belongs to the XReflection classes.
Since XReflection is becoming too big for this project, and frankly, even becoming an offtopic project,
I'm planning to split it into its own project. However, XSeries will
continue to use the stage I and stage II of XReflection as a dependency, but unnecessary classes will be excluded to decrease
the JAR file size. This new project will use Gradle as its build system as it's going to be multimodule with its own custom
IntelliJ plugin to make things easier. For now, XReflection will remain in XSeries until the preparations are done.
Paper's Reflection Remapper
Also, I've just saw this after finishing the stage IV (ASM generated classes), but
it seems like Paper also has a similar project named Reflection Remapper
which uses a similar interface-based system as well. However, there are some features that is missing from that project:
- ReflectionRemapper uses raw Java proxies (similar to Stage III - ReflectiveProxy in our project) but we also have ASM-generated classes as well
which will improve performance significantly with almost zero overhead. - ReflectionRemapper only supports mappings for a single version.
- ReflectionRemapper doesn't support proxy objects for return types or parameters.
- ReflectionRemapper doesn't have isInstance(), instance(), and getTargetClass(). I also plan to add a way to check whether
a method is supported or not, however ReflectionRemapper doesn't have this feature. - ReflectionRemapper doesn't have a proxy class generator utility.
- ReflectionRemapper cannot use real classes with fields, constructors and methods. However, this is going to be added to XRefleciton.
There are some other projects that are also similar to this as well, but none of them have the complete feature set that I have in mind.
Any suggestions or improvements are welcome to the current XReflection systems while it lasts here.
-
Added experimental ReflectiveConstraint API for XReflection to make targets more precise.
-
Added XAccessFlag used mainly for ReflectiveConstraints.
-
Fixed
ENTITY_EXPERIENCE_ORB_TOUCH
v1.9 missing value for XSound. -
Improved ReflectionParser.
-
Improved Unit Tests.
-
Added
@Contract
annotations to most APIs. -
[XBiome] Fixed an issue with world min/max height.
-
[XTag] Fixed
INVENTORY_NOT_DISPLAYABLE
for wheat. -
[XReflection] Using the suffix support for JetBrains
@Language
annotation, we no longer need to add semicolons or{}
at the end of string APIs. Other than the readability improvement, this results in a slight performance
improvement as well, since fewer characters are needed for parsing. -
More compliance with common best code practices.
- Replaced
RuntimeException
s with suitable exceptions. Mostly defaulted toIllegalStateException
when the error is too generic. - Replaced
Cloneable
and itsclone()
methods withcopy()
- Refactored some parts of the code for better readability.
- Not all of these practices make sense, so I skipped some of them.
- Replaced
-
Added experimental ReflectiveProxy API (XReflection Stage III - Proxification) which is has a significant readability advantage but
has a significant
performance disadvantage which makes it unusable in most sitautions, however this prototype will allow us to
develop the next reflection API (Stage IV) which will have significant advantage in terms of both readability and
performance if it's successful. -
Added experimental XReflectASM API (XReflection Stage IV - ASMification) which is the same as ReflectiveProxy which massive performance
advantages that beat raw reflection because of generated code. However, this performance advantage is not as perfect for
inaccessible class members. This is because of Java's Jigsaw project, and we need to use some really hacky workarounds to
make this work for inaccessible methods. ReadXReflectASM#MAGIC_ACCESSOR_IMPL
field for more info.
Once this is done, we can enter XReflection Stage V. It comes with an XProxifier which currently must be used programmatically. -
Added JMH Benchmark which is not 100% reliable due to:
- Running inside IDE testing environment which can be affected by many external factors instead of using a JAR.
- Not running in forked mode. We need to retain the server state.
- Being run using Maven's exec plugin which might be able to affect our benchmarks.
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
@XMerge
annotation 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
XReflection
with a few renames and bug fixes. - Added enum support for
XReflection
. - Changed the default material for
XItemStack
.