Skip to content

Fix memory usage and chunkcache#18

Open
Trainboy15 wants to merge 37 commits into
TuffNetwork:mainfrom
Trainboy15:main
Open

Fix memory usage and chunkcache#18
Trainboy15 wants to merge 37 commits into
TuffNetwork:mainfrom
Trainboy15:main

Conversation

@Trainboy15
Copy link
Copy Markdown

IDK if it works put it compiled so...

Also u might want to add back the deploy to testers repo, but i had to remove it

@Trainboy15
Copy link
Copy Markdown
Author

@UplandJacob If you could test the TuffXPlus-1.0.0-patch that would be great

@bobhenl
Copy link
Copy Markdown

bobhenl commented May 18, 2026

image Still seems to be a bit crazy @Trainboy15

maybe resetting cache more often or not saving so many things to it?
https://spark.lucko.me/JKyN8ssn5p

@Trainboy15
Copy link
Copy Markdown
Author

I agree, it prob shouldent use 24GB, but it seems at least a bit better than 36GB

@Trainboy15 Trainboy15 marked this pull request as draft May 18, 2026 20:45
@bobhenl
Copy link
Copy Markdown

bobhenl commented May 19, 2026

[13:12:19] [Server thread/INFO]: [TuffXPlus] Enabling TuffXPlus v1.0.0-patch
[13:12:19] [Server thread/INFO]: [TuffXPlus] [Y0] Server Minecraft Version: 1.21.11
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaBlocks] Generating ViaBlocks Pre-Defined Palette...
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaBlocks] Palette initialized with 649 entries.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaBlocks] Paper detected. Enabling optimized asynchronous scheduling.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaBlocks] ViaBlocks has been enabled successfully and is listening for client handshakes.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaEntities] ViaEntities enabled with 43 modern entities
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] Successfully loaded 1326 creative tab mappings.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] TuffActions has been enabled
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] Enabling features...
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] Swimming enabled.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] Creative Items enabled.
[13:12:19] [Server thread/INFO]: [TuffXPlus] [TuffActions] Finished enabling features.
[13:12:19] [Server thread/ERROR]: Error occurred while enabling TuffXPlus v1.0.0-patch (Is it up to date?)
java.lang.IllegalArgumentException: This registration already exists
	at org.bukkit.plugin.messaging.StandardMessenger.addToIncoming(StandardMessenger.java:96) ~[leaf-api-1.21.11-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.messaging.StandardMessenger.registerIncomingPluginChannel(StandardMessenger.java:228) ~[leaf-api-1.21.11-R0.1-SNAPSHOT.jar:?]
	at TuffXPlus-1.0.0-patch.jar//tf.tuff.TuffX.onEnable(TuffX.java:87) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[leaf-api-1.21.11-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:207) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:519) ~[leaf-api-1.21.11-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:658) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:615) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at net.minecraft.server.MinecraftServer.initPostWorld(MinecraftServer.java:690) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:426) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1330) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:430) ~[leaf-1.21.11.jar:1.21.11-144-d0ed97c]
	at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]
[13:12:19] [Server thread/INFO]: [TuffXPlus] Disabling TuffXPlus v1.0.0-patch
[13:12:19] [Server thread/INFO]: [TuffXPlus] [ViaBlocks] ViaBlocks has been disabled.

@Trainboy15
Copy link
Copy Markdown
Author

Trainboy15 commented May 19, 2026 via email

@Trainboy15
Copy link
Copy Markdown
Author

K it should be fixed... use the latest bulid after it gets done

@Trainboy15
Copy link
Copy Markdown
Author

@bobhenl If you could test it now that would be great

@bobhenl
Copy link
Copy Markdown

bobhenl commented May 19, 2026

where can be the build downloaded btw, I don't see it in actions

@Trainboy15
Copy link
Copy Markdown
Author

@Trainboy15
Copy link
Copy Markdown
Author

Download here @bobhenl

@bobhenl
Copy link
Copy Markdown

bobhenl commented May 20, 2026

image 💀 https://spark.lucko.me/vCOcRA41ge https://spark.lucko.me/q9XEYH12qu image

@Trainboy15
Copy link
Copy Markdown
Author

💀, I might have fixed it, let me know

@UplandJacob UplandJacob mentioned this pull request May 21, 2026
Copy link
Copy Markdown
Contributor

@UplandJacob UplandJacob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! I've really needed to do a pass like this for a while but haven't had the time, so thanks for the help. I know this PR is still a draft, but I have some random comments to think about:

  • Make sure you're not adding any new trailing whitespace. I've got some cleanup to do, but I don't need more 😭.
  • Please don't mess with the feature loading in this PR since that involves a bunch more work to make sure everything can be reloaded.
  • Please make a separate PR for the update detector. It looks good; I just can't comment on both at the same time.

I really like having some tests in our workflow; that will be nice for validation.

Comment thread src/main/java/tf/tuff/TuffX.java Outdated
Comment thread src/main/java/tf/tuff/TuffX.java Outdated
}

public void setChunkInjector(tf.tuff.netty.ChunkInjector injector) {
if (injector == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's just a single null check, the return in a single line without a block will look cleaner. I'm trying to standardize this in our codebase, so it would be great if you could do it everywhere.

Comment thread src/main/java/tf/tuff/y0/Y0Plugin.java
Comment thread .github/workflows/gradle.yml
Comment thread builds/TuffXPlus-1.0.0-patch-2.jar
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread .github/workflows/test.yml
Comment thread build.gradle Outdated
@bobhenl
Copy link
Copy Markdown

bobhenl commented May 21, 2026

image https://spark.lucko.me/ZF1ev0euUM seems to be better, but maybe ifit can be even more it would be good

@Trainboy15 Trainboy15 marked this pull request as ready for review May 21, 2026 17:17
@bobhenl
Copy link
Copy Markdown

bobhenl commented May 22, 2026

image btw is it checking just eagler players? https://spark.lucko.me/pvGBrzMdbI image https://spark.lucko.me/CfTf6fEcPk image

@Trainboy15
Copy link
Copy Markdown
Author

Not sure 100%. will look into it

}

public void setChunkInjector(tf.tuff.netty.ChunkInjector injector) {
if (injector == null) { return; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (injector == null) { return; }
if (injector == null) return;

This is what the meant. It literally doesn’t need a block at all.

private ChunkInjector chunkInjector;
private static final String CURRENT_VERSION = "1.0.0-patch";
private static final String BUILDS_API_URL = "https://api.github.com/repos/Trainboy15/TuffXPlus/contents/builds";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've still got a lot of update checker things here that should be in a new PR

return true;
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this

@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent e) {
y0Plugin.handlePlayerJoin(e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you've made this PR from your main branch, the Action keeps updating the builds. You should really create a separate branch to make this PR from.

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.

3 participants