Skip to content

Cleanup3#2414

Merged
dmulloy2 merged 36 commits intodmulloy2:masterfrom
Photon-GitHub:Cleanup3
Jun 5, 2023
Merged

Cleanup3#2414
dmulloy2 merged 36 commits intodmulloy2:masterfrom
Photon-GitHub:Cleanup3

Conversation

@Photon-GitHub
Copy link
Copy Markdown
Contributor

@Photon-GitHub Photon-GitHub commented May 31, 2023

This is mainly my old #1776 pr for modern protocollib, with a few additions (and minus the breaking IntSet change).

The most notable one is the fast growing algorithm for IntegerMap, which directly calculates the next power of 2 instead of looping and checking for an overflow.

@lukalt
Copy link
Copy Markdown
Contributor

lukalt commented May 31, 2023

Looks good to me. Maybe add some unit tests for the regrowing of the IntegerMap. At least to me, it is not obvious that it works as expected.

What about reformatting the whole project to a consistent indention (4 spaces instead of tabs) in this course?

@Photon-GitHub
Copy link
Copy Markdown
Contributor Author

Looks good to me. Maybe add some unit tests for the regrowing of the IntegerMap. At least to me, it is not obvious that it works as expected.

What about reformatting the whole project to a consistent indention (4 spaces instead of tabs) in this course?

I have extracted the method to a new util class, so it is still usable from other classes. It is basically a copy of the ceilingPowerOfTwo method from guavas IntMath, but the 1.8 guava version is too old.

@derklaro
Copy link
Copy Markdown
Contributor

derklaro commented Jun 1, 2023

I'm thinking that it might be better for some codestyle related cleanups to be in a different PR. The way you change some if condition body locations, import order, ... should be defined by a fixed codestyle settings (such as google-style) and enforced via checkstyle. I'm ok with the replacement of some method calls, lists, .... tho 👍

@lukalt
Copy link
Copy Markdown
Contributor

lukalt commented Jun 5, 2023

@dmulloy2 It would be great to have this merged and ProtocolLib 5.1.0 being released ASAP as Minecraft 1.20 will be released in 2 days.

@dmulloy2 dmulloy2 merged commit c1ceb47 into dmulloy2:master Jun 5, 2023
@Photon-GitHub Photon-GitHub deleted the Cleanup3 branch June 5, 2023 16:24
@Pantera07
Copy link
Copy Markdown

Pantera07 commented Jun 7, 2023

This version (#647) sometimes throws errors and the server runs without ProtocolLib.

[11:31:36] [Server thread/INFO]: [ProtocolLib] Loading server plugin ProtocolLib v5.1.0-SNAPSHOT-647
[11:31:37] [Server thread/ERROR]: [ProtocolLib] Error initializing plugin 'ProtocolLib.jar' in folder 'plugins' (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolConfig.isChatWarnings()" because the return value of "com.comphenix.protocol.ProtocolLibrary.getConfig()" is null
	at com.comphenix.protocol.error.DetailedErrorReporter.reportDetailed(DetailedErrorReporter.java:394) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:63) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:87) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:186) ~[ProtocolLib.jar:?]
	at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:40) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:440) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:310) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1120) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:325) ~[purpur-1.19.4.jar:git-Purpur-1982]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants