ProtocolLib

3M Downloads

Latest dev builds break API backwards compatibillity

WillFP opened this issue ยท 2 comments

commented
  • This issue is not solved in a development build

Describe the bug
A method signature has changed, breaking my core plugin (breaking all of my other plugins)

To Reproduce
Steps to reproduce the behavior:

  • Write against stable version
  • Users use dev version for 1.19 support
  • Breaks
    Function was replaced with UnaryOperator, breaking things. Might make sense to just keep the old method and have it delegate to the new one.

Expected behavior
It shouldn't break. The method signature should be the same.

Screenshots

java.lang.NoSuchMethodError: 'com.comphenix.protocol.reflect.StructureModifier com.comphenix.protocol.reflect.StructureModifier.modify(int, com.google.common.base.Function)'```


commented

Yea, the dev version is v5 while the release version is v4 so there are small breaks expected. While we keep them as small as possible we cannot avoid them completely to clean up the api... Requiring v5 for 1.19 wasn't the best idea either, but everything was a bit stale last month as we initially waited for 1.19.1, which then didn't release...

The best thing for now is probably to make a class for the function, like:

	public class Function implements UnaryOperator<String>, Function<String, String> {

		@Override
		public String apply(String s) {
			return s;
		}
	}

supersorry

commented

Good idea, i'll add that for cross-compat