Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract away from just about everything #136

Draft
wants to merge 423 commits into
base: master
Choose a base branch
from

Conversation

DaMatrix
Copy link
Member

@DaMatrix DaMatrix commented Dec 23, 2021

This is a huge PR (which, in retrospect, probably should have been broken up into multiple smaller PRs). In combination with #117, it makes the vast majority of the codebase be able to operate entirely independently of the Minecraft version being used.

Additional major changes include:

  • The tile size for heightmap and voxel modes are now separate. The replacements for T_SHIFT and related constants are now to HeightmapConstants/VoxelConstants
  • The makefile-based system for compiling native code has been replaced with a Gradle plugin. This should make future changes substantially easier.
  • GUI code is completely rewritten.
  • All of the static event handler classes have been replaced with a universal FEventBus, which uses a familiar annotation-based event subscription system. It supports a few additional features not commonly found in other event buses, such as the ability to weakly reference a registered handler object, and generic parameter matching.
  • The @DebugOnly annotation is now gone. Debug statistics and related features are now available outside of debug mode.
  • Logging is now routed through a PorkLib Logger, as are messages which appear in the client-side chat menu.

With the exception of the :gl module and children (which are handled by #117), nearly everything is affected in some way.

Known shortcomings:

  • GPU frustum culling will currently crash on heightmap mode.

# Conflicts:
#	mc/1.12.2-forge/build.gradle
#	settings.gradle
…promoted to a batch

also do some internal refactors, and use lists in a lot of places where they weren't being used previously
also replace supportsLowResolution() with canGenerate(POS) in rough generator api
…les need to be marked as dirty

the previous code was just using up(), which wouldn't have necessarily resulted in correct behavior
apparently i spoke too soon, and the offset is still necessary to avoid seams
this is to prepare for moving them back onto the heap
also deleted DirectLongStack, which has been un-used for months
also fixed a bug in SimpleList and deleted 1.12.2-forge's AsyncCacheNBTBase, which is unused
unit tests were failing on jenkins due to lack of memory, 1000000 points were probably a bit excessive anyway

coordinate limits were one too high on each axis, although i've had to keep them high on voxel mode's Y axis for now because of the way that tiles aren't perfectly aligned to anything. this will be resolved once voxel tiles actually contain voxels rather than a weird voxely-mesh thing.

sky light levels are supposed to be full above the build limit, so i've fixed that
this will avoid any future library conflicts
this avoids polluting the gradle classpath with a bunch of plugins which aren't required by all subprojects
…urces

this ensures that we're referring to the correct texture ID when changing resource packs
rather than (quite badly) guessing the size of the OS send window, i've turned it into a system which relies on platform-specific methods to implement flow control. currently, this is only implemented for the following:
- local (singleplayer) connections, which use no flow control at all
- servers using Epoll (Linux), where Netty exposes an interface to set TCP_NOTSENT_LOWAT on the underlying native socket to a low value, as described in https://blog.cloudflare.com/http-2-prioritization-with-nginx/

other connections currently have no optimizations, and will "flow control" comparatively poorly by simply sending packets until the OS send window fills up. however, this isn't a priority, as the only two platforms in question are Windows and OSX, neither of which are commonly used for hosting servers - likely the only time servers will be run on these platforms is for LAN worlds, where flow control will be less important anyway thanks to a (presumably) fast LAN.
note to self: it helps if you run your code after you change it. i really need to figure out how to run integration tests on the entire game...
lmao i never ended up using this
In all honesty, I should probably re-implement the off-heap stuff in native code - this is horrifically ugly in Java.
This prevents tons of unnecessary disk writes when toggling debug settings back and forth.
This makes NoFutureScheduler go through BlockingSupport when polling the work queue, so that interrupts actually get sent and are handled immediately.
We no longer distinguish between add/modify/remove notifications, which makes the code quite a bit easier to work with. Also, it now supports bulk notifications (although there aren't yet any optimized implementations of this yet), and it uses the new ListenerList infrastructure for (theoretically) improved performance!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants