Commit Graph

139 Commits

Author SHA1 Message Date
Spottedleaf
0391e7beff Use custom random in block random ticking
The CAS performed by the regular random appears expensive.
These changes drop my server tick time locally @ tickSpeed = 10,000
from 53ms to 37ms.
2024-08-14 14:48:01 -07:00
Spottedleaf
48504e990e Start README 2024-08-14 13:06:16 -07:00
Spottedleaf
5385e6f2cb Fix ViewDistanceHolder#setSendViewDistance updating tick distance
It should update the send view distance.
2024-08-14 12:22:33 -07:00
Spottedleaf
763fb751cb Add TickThread check to ServerChunkCache#getChunkNow
We shouldn't be using the currently loading chunk unless
we are on the main thread.
2024-08-14 12:17:46 -07:00
Spottedleaf
fc9d35c4b0 Store ticking blocks in chunk sections as positions only
Since we no longer use the state stored directly in the
IBlockDataList, it makes no sense to use IBlockDataList
at all.
2024-08-13 23:53:27 -07:00
Spottedleaf
a749c7282b Cache x coordinate multiplier for CollisionUtil#sliceShapeOptimised
This is consistent with how the rest of the collision patch iterates
the voxel bitset.
2024-08-12 16:56:26 -07:00
Spottedleaf
e68d381fc5 Avoid creating SliceShape when retrieving Voxelshape faces
SliceShape is not always the ideal shape, as sometimes the
face result is empty or full cube - but is represented as
SliceShape. Additionally, sometimes SliceShape should be
empty but isEmpty() is false.
2024-08-11 22:11:59 -07:00
Spottedleaf
c0a2e488fc Fix client command registration for Fabric
The dispatcher is not actually available during mod init. So,
use the event callback.
2024-08-10 20:29:29 -07:00
Spottedleaf
c5778192f6 Add overwrite for StateHolder#trySetValue
Now that we do not initialise the Vanilla table field,
we need to overwrite this method as well with our own
implementation.
2024-08-10 16:16:11 -07:00
Spottedleaf
65481aee6d Fix init in FlowingFluidMixin
The fluid state may have additional properties, so it is
inappropriate to iterate over all of the states and assume
that there will be no duplicate values with the same falling
and level property values.
2024-08-10 14:59:06 -07:00
Spottedleaf
edad8be41f Drastically reduce memory footprint of ZeroCollidingReferenceStateTable
We can linearize the table lookup by generating an index per
state using the property values.
2024-08-10 14:33:54 -07:00
Jason Penilla
cbdcab7267 Get BooleanProperty equals injection working using @WrapOperation on the instanceof check 2024-08-09 10:15:23 -07:00
Spottedleaf
f4f76707ed Add default implementation for Property id lookups
Just in case mods implement their own Properties which are
neither boolean, enum, nor integer.
2024-08-09 01:23:47 -07:00
Spottedleaf
4b8778cbe7 Class check EnumPropertyMixin#getIdFor
This should prevent invalid usages with the wrong enum type.
2024-08-08 23:33:27 -07:00
Jason Penilla
2b5c570ec3 Make BooleanPropertyMixin and UtilMixin more compatible 2024-08-08 22:18:36 -07:00
Spottedleaf
13374ad4a0 Make thread count mixin less aggressive
Redirect the thread pool construction instead of overwriting
the method.
2024-08-08 21:28:39 -07:00
Jason Penilla
cd5b6c037b Initial profiler commands (#2)
* Initial profiler commands

* copy paste

* leaf

* add todo

* command feedback

* Allow all commands in SP without cheats

* fix SP command check

* make client commands actual client commands

* Start client profile command implementation

* Remove ArgumentParser class

---------

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2024-08-08 21:07:13 -07:00
Spottedleaf
55e053b4be Add profiler instance back
This time we wrap the Vanilla profiler so that the F3 screen
works.
2024-08-08 17:30:56 -07:00
Spottedleaf
2fcae456b9 Band-aid fix bad mods throwing on getAmount()
https://github.com/JDKDigital/productivetrees/issues/16
2024-08-08 16:49:59 -07:00
Spottedleaf
09d9292f90 Adjust default config location
Place the config in config/
2024-08-08 16:22:52 -07:00
Spottedleaf
bbe9c0c041 Fix collidedY being ignored in EntityMixin#calculateStepHeights 2024-08-08 16:11:04 -07:00
Spottedleaf
8a10eac5a2 Update Entity#collide to new step height calculation
I missed the step height changes. This should bring the function
in-line with Vanilla.
2024-08-08 15:48:50 -07:00
Spottedleaf
810c57a99d Remove final qualifier from methods implemented in Level
Some mods override these.
2024-08-07 16:43:53 -07:00
Spottedleaf
ff20c163a4 Remove TODO for ExplosionMixin onExplosionHit
Didn't need to be ported to Paper, was only broken here.
2024-08-07 06:36:05 -07:00
Spottedleaf
2f97c1e3c3 Always invoke config initialisers
This resolves an issue where the worker threads were not
initialised if the config file did not exist already.
2024-08-07 06:18:30 -07:00
Spottedleaf
0dd063ecac Update neoforge version 2024-08-07 05:59:00 -07:00
Spottedleaf
1053a51d1d Initial pass of implementing clobbered neoforge API 2024-08-07 05:34:01 -07:00
Spottedleaf
c3f31b1c90 Replace tabs with spaces 2024-08-07 02:09:40 -07:00
Spottedleaf
5bc1ba2feb Some neoforge compatibility
Drop farm block mixin, doesn't appear to be fixing streams
anymore so it's not useful.

Also, implement the force ticks api and make it thread-safe.
2024-08-07 02:06:18 -07:00
Jason Penilla
eada4f58bc Make mixins not public and add editorconfig 2024-08-07 02:05:40 -07:00
Spottedleaf
93eca8e994 Add configuration UI for some elements of the moonrise config
Mostly the important things: chunk load rates,
thread pool threads, and bug fix toggles.
2024-08-07 01:38:53 -07:00
Jason Penilla
426d2ec30c gen ide runs 2024-08-07 00:15:56 -07:00
Jason Penilla
5eb3f82cee fix neo dev run 2024-08-07 00:04:09 -07:00
Jason Penilla
efb75dbe5b fix jar path 2024-08-06 23:21:58 -07:00
Jason Penilla
d8f82ec045 setup config screen 2024-08-06 22:22:23 -07:00
Jason Penilla
b6456c44de move cu version to props 2024-08-06 21:49:45 -07:00
Jason Penilla
fb8cbbede9 coerce the mod into running at dev time (fabric & forge) 2024-08-06 21:49:45 -07:00
Jason Penilla
d93cc978e3 Add PlatformHooks 2024-08-06 21:49:44 -07:00
Jason Penilla
c8d18ca479 Split some mixins to their platforms 2024-08-06 21:49:44 -07:00
Jason Penilla
a87cf17bd1 Setup multi-project build 2024-08-06 21:49:42 -07:00
Jason Penilla
f463fbeb23 Initial NeoForge port
Gets into world with no other mods. Currently nukes a bunch of API calls.
2024-08-06 21:49:10 -07:00
Spottedleaf
4442452c52 Fix shading ConcurrentUtil dependencies
Update ConcurrentUtil to fix the dependency scopes
2024-08-06 21:40:39 -07:00
Spottedleaf
bfaddd34fc Update to ConcurrentUtil 0.0.2, and refactor I/O + worker pool
With ConcurrentUtil 0.0.2, we can make all thread pools
(worker+I/O) have their thread counts configurable on the fly.

The new I/O system splits the compression/decompression work
from the I/O. The compression/decompression is ran on the worker
pool, while the I/O is ran on the I/O pool. This allows for
better cpu utilisation control on systems with low core counts,
and allows higher read/write speeds on systems with higher
core counts.

Additionally, the I/O scheduling for thread counts > 1 is also
improved as it longer selects a thread to schedule based on the
chunk location.
2024-08-06 21:25:08 -07:00
Spottedleaf
6a2c6d27df Update build system, relocate libraries
We should be relocating our libraries just in case there are
other mods that ship the same libraries, although I doubt
any actually will.
2024-08-04 04:22:38 -07:00
Spottedleaf
ffec3386d3 Adjust description to remove mentions of client
We don't really have any client optimisations right now.
2024-08-01 18:22:37 -07:00
Spottedleaf
c2a0585f2a Update ConcurrentUtil to fix concurrent long map iteration on resize 2024-08-01 16:51:03 -07:00
Spottedleaf
63f4fea60c Make loading screen patch skip chunk waiting
We do actually need to wait for some other information from the
server before closing the screen.
2024-07-30 01:37:31 -07:00
Spottedleaf
c77e782eb1 Use yaml linebreak for header, trim header lines
This brings the header serialization in-line with the
comment serialization.
2024-07-29 19:33:08 -07:00
Spottedleaf
8faded3521 Disable loading screen
This will let users load worlds slightly faster.
2024-07-29 15:04:43 -07:00
Spottedleaf
3351f9d5df Skip reverse DNS lookup when connecting/pinging servers
The rDNS is not cheap and is not necessary. We skip the
rDNS by providing the input address as the host name when
the input address is a plain ipv4/ipv6 address.
2024-07-29 05:53:06 -07:00