Commit Graph

29 Commits

Author SHA1 Message Date
Camotoy bc0cfde8f9
Set the minimum Java version to 16; drop Bedrock 1.17.0 (#2477) 2021-09-10 14:10:56 -04:00
Camotoy 93f5298ee3
Introduce specialized maps for block state operations
By introducing fixed maps, we are able to reduce the overhead of needing to store arbitrary numbers; fixed maps start at one number and must be sequential. This commit also reduces some overhead of lecterns in block updating as we are able to utilize our own maps to reduce object boxing and removing the function of Map#compute of trying to re-insert a value.
2021-09-09 21:33:48 -04:00
David Choo 8461cf76b7
Smooth Pistons (#1542)
With proper piston collision for players as well.
2021-09-09 21:20:25 -04:00
Redned 9f77d47f14 Set int array directly for BlockMappings and change naming 2021-09-04 12:45:32 -05:00
Redned 64b0788012 Use an array for java blocks and replace rarely used map in BlockMappings 2021-09-04 12:36:09 -05:00
Camotoy bb92c89273
Small optimizations; use array for Java -> Bedrock block mappings
Java runtime IDs are in order starting from 0; an array is all that is needed to map Java IDs to Bedrock IDs.
2021-08-27 20:10:01 -04:00
Camotoy 0c5b39f35b
Intern strings and other values
This should reduce memory usage at startup by preventing multiple identicals objects being present in memory.
2021-08-11 20:16:10 -04:00
David Choo 1d04a61a46
Collision Registry (#2430)
* Fix trapdoor collision

* Add EqualsAndHashCode to all Collision subclasses and shift code around

EqualsAndHashCode are required on subclasses otherwise blocks will be assigned an incorrect collision instance. (Doors and trapdoors are mixed and ladder sometimes gets a DoorCollision instance).
Added protected constructor to BlockCollision to make boundingBoxes final.
Removed EmptyCollision because I don't think it is useful.
Moved conversion from ArrayNode to BoundingBoxes[] from OtherCollision to CollisionRegistryLoader
Removed regex from SnowCollision and use default bounding boxes.

* Deduplicate BlockCollision instances

* Create one set of bounding boxes for all BlockCollisions

* Don't depend on the player's block position in DoorCollision

* Fix dirt path position corrections

Grass paths were renamed to dirt path in 1.17
Fix position correction for y=1, y=2, y=255, and y=256

* Increase pushAwayTolerance depending on distance from origin

This should fix position corrections for blocks less than 1 unit in length/width at high coordinates.
This includes ladders after x 4096 or z 4096
Not too sure about the math here though

* Use ThreadLocal for position

Hopefully resolves concurrency issues

* Remove comment and add layer check to SnowCollision
2021-07-30 22:35:13 -04:00
Camotoy 8c96c3b11d
Biome reworkings
- Introduce biome mappings for having a constant reference between Java biome identifier and their Bedrock equivalents
- Don't assume biome IDs and instead listen to the server for biome IDs
- Ensure that only valid Bedrock biomes are sent. With the caves and cliffs experimental toggle, Bedrock will crash if an invalid biome ID is sent its way.
2021-07-27 20:29:27 -04:00
Redned c3f65b176d Tweak README - Geyser is fine on production and has been for a while :) 2021-07-21 22:31:54 -05:00
Redned 0e30895302 More registry documentation, and remove unneeded clean identifiers registry 2021-07-21 22:18:31 -05:00
RednedEpic 9817dc932a Merge branch 'feature/optimizations' into master 2021-07-21 21:44:49 -05:00
Redned 4a8e598c62 Document the registry system (Closes #2387) 2021-07-21 21:14:00 -05:00
Redned 95a1cbfa24 Some more micro optimizations 2021-07-18 15:43:04 -05:00
Redned b4921132e1 Replace BiMap with an Object2IntBiMap 2021-07-18 14:43:17 -05:00
Redned fde36a2234 Fix check for missing item mapping and update mappings submodule 2021-07-18 12:47:02 -05:00
Camotoy 697f35f657
Specify the first and last relevant block runtime IDs for items
Improves startup time and processing
2021-07-17 18:09:55 -04:00
RednedEpic ff280ef192 Replace Reflections usage with an annotation processor
Reduces jar size by about 1.5-2mb
2021-07-17 13:36:04 -05:00
Camotoy 80b8d18c31
Replace more instances of String#split with BlockUtils#getCleanIdentifier 2021-07-17 09:43:25 -04:00
David Choo 4e629feee8
Fix block unique Java IDs (#2390) 2021-07-17 09:33:38 -04:00
Camotoy 4844302883
Merge branch 'extended-world-height' 2021-07-16 20:21:43 -04:00
Camotoy 01873ea566
Change some comments 2021-07-16 20:18:13 -04:00
Camotoy f03a2dd317
Remove goat horn from creative menu; use proper sculk sensor item 2021-07-16 12:28:11 -04:00
Camotoy 25edf41329
Some optimizations
- Fix recipe registry not using an int key-based map
- Versioned registries now use Fastutil more effectively
- Replace uses of String#split for block identifier manipulation with #indexOf and #substring
- Reuse Patterns in collision loader
2021-07-15 18:03:41 -04:00
Camotoy c7d4130a44
Start of extended world height support 2021-07-13 20:48:45 -04:00
Redned f7ef90278b
Implement a new registry system (#2306)
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-07-12 21:19:40 -04:00
Camotoy c588127648
Yeet block tool type
This is 99% controlled by the server now.
2021-05-19 22:34:50 -04:00
Camotoy dda0172ded
Allow more blocks to have a place sound on standalone (#2183)
Items such as wall torch blocks currently do not have a place sound on standalone, as their block identifier differs from their item identifier. This commit uses the pick item logic in order to fix place sounds for such blocks.
2021-05-09 01:19:06 -04:00
Camotoy ce000a496b
Use tags sent from the server, where possible (#2188)
Java Edition has a tags system that allows for some server-side control of certain properties. This PR allows for piglin trading items, wool, and flowers to be determined from the server.
2021-05-02 21:47:11 -04:00