Commit Graph

62 Commits

Author SHA1 Message Date
Camotoy 123b074cc7
Update to Bedrock 1.16.100 (#1552)
* Initial work on 1.16.100 - currently crashes the client

* Update runtime item states

* Use new Bedrock runtime IDs

Bedrock now hardcodes block runtime IDs in alphabetical order of the identifiers. This commit updates Geyser to accomodate.

- Remove runtime_block_states.dat and replace it with blockpalette.nbt
- Calculate the block runtime ID based on the order of the block palette
- Separate BlockTranslator.AIR into Bedrock and Java values
- Update the second layer of chunks to use air when not waterlogged
- Don't send item palette for now, as that's what crashes the game (will look into for v415)
- Other misc. changes

* Improve second layer chunk translation

* v415 support

- Add a message warning people they are on a beta version of Geyser

* Update to protocol v417

There are still some mappings changes that need to be gone through.

* Update runtime item states and clean up item frames

* Future-proof enchanment table

* Update for v418

* Update to v419

* Apply proper air ID to waterlogged chunk layer

* Fix missing import

* Remove beta warning

* Update mappings

* Manually patch runtime_item_states and send the ITEMS registry

* Update README

* Disable grindstone and smithing inventories (since they're broken)

* Use artifactory jenkins plugin (#1548)

* Use artifactory jenkins plugin

* Bump version to 1.2.0-SNAPSHOT

Co-authored-by: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com>
2020-11-17 11:03:12 -06:00
Camotoy 445444204f
Fix GlobalPalette translation (#1528)
* Fix GlobalPalette translation

Global palettes don't have their own internal palette, which cannot be iterated through to create a Bedrock palette. Therefore we simply iterate over the whole palette one time. This commit also fixes a regression with flowers/pistons being on multiple chunk sections.

* Don't declare bedrockPalette until after global palette check
2020-11-14 12:05:33 -06:00
Tim203 c64d57439f
Block entity performance improvements (#1481)
* BlockEntity performance improvements

* Use chunk cache if possible for block caching

* Get new block state from ViaVersion if block entity

* Add Javadoc for FlowerPotBlockEntityTranslator.isFlowerBlock

* Remove debug line

* Don't add all RequiresBlockState instances if cache chunks is enabled

* Double chest map get optimization

* Last changes

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-05 22:36:22 +01:00
DaPorkchop_ 7d2745dee6
Faster chunk conversion (#1400)
* BlockStorage is never used concurrently, no need to synchronize

* initial, semi-functional, faster chunk conversion

* faster chunk conversion works well for every situation except spigot

* delete unused ChunkPosition class

* preallocate and pool chunk encoding buffers

* make it work correctly on spigot

* make field naming more consistent

* attempt to upgrade to latest MCProtocolLib

* remove debug code

* compile against my MCProtocolLib fork while i wait for my upstream PR to be accepted

* return to Steveice10 MCProtocolLib
2020-10-15 01:30:25 -05:00
DaPorkchop_ 191777773c
Don't use wrapper objects for positions in ChunkCache (#1398)
* make ChunkPosition use a hashCode implementation with far better hash distribution

this should improve the performance when used as a hash table key

* ChunkCache no longer uses position wrapper objects

this yields a roughly 15-20% increase in performance when converting chunk data

* fix code style issues
2020-10-13 15:44:47 +01:00
Camotoy 5b76a85895
Non-full-chunk support (#574)
This commit adds non-full chunk support if chunk caching is enabled.
2020-09-03 19:00:36 -04:00
Camotoy 8b7165a564
Implement (hopefully) temporary dimension switching fix (#1188)
This fixes rare (?) instances where dimension switching doesn't finish loading on the client. Ideally a proper fix would send the finishing packets in the correct order but I didn't get far in this regard.

Fixes #1154 and #1072.

Other miscellaeous chunk-related fixes have also been included here.
2020-08-24 09:31:21 -04:00
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05:00
DoctorMacc fc4a87a9c9 Fix blocks not updating 2020-06-29 16:46:29 -04:00
DoctorMacc d6119375b2 (Incomplete) Update MCProtocolLib 2020-06-18 21:44:50 -04:00
Camotoy 7fcd8f2daf
Fix block entities on older versions (#756)
* Fix block entities on older versions

This commit solves two problems related to block entities on older versions:

- Occasionally, tags would contain the ID under a StringTag with an empty value, and not the ID tag.
- The block entity regex did not account for block entity tags that were already in a Bedrock-compatible format (BlockEntity)

* Move BLOCK_ENTITY_TRANSLATIONS to BlockEntityTranslator
2020-06-10 18:02:29 -05:00
RednedEpic 6b68bbb413 Large refactoring to item translator and registry/util classes
- Merged ItemTranslator and ItemStackTranslator together.
- Split ItemTranslator into two classes: ItemTranslator and ItemRegistry. The registry is where items are registered, and the translator class is where item translation takes place.
- Made most of ItemTranslator's methods static and removed the initialization in Toolbox.
- Moved a handful of registry classes previously ending with 'Utils' to a 'Registry' class to be more fitting for the term.
- Moved inventory and block entity registration out of Translators.
- Renamed Translators to PacketTranslatorRegistry.
- Yeeted Toolbox.
- Minor cleanups and small refactors.
2020-05-24 20:07:05 -05:00
Camotoy f11bae0bf0
Fix signs (#439)
* Fix signs on everything except Paper

* Fix sign line placement

* Update shulker box block entity

Co-authored-by: James Harrison <james@fasttortoise.co.uk>
2020-05-06 16:52:57 -05:00
Luke 7195d20fae
Implement helper methods for sending packets (#487)
* Implement helper methods for sending packets, fixes an NPE when chatting before connecting to the remote server

* Change method names

* Add a space between doc comment lines

* Add debug messages
2020-05-05 10:51:43 -05:00
Camotoy b49004ddaf
Add block entity translators for Bedrock-only block entities (#478)
* Initial work on flower pots

* Flowers work in-game, not yet chunk load

* Don't overwrite my code before merge

* Finish up flower pots; add piston support on chunk load

* Clean up

* Remove debug line; update mappings
2020-05-04 21:32:02 -05:00
RednedEpic 3370ad3db9 Merge branch 'master' into feature/sounds 2020-05-02 23:06:53 -05:00
Camotoy 9846058377
Add item frames (#415)
* Initial attempt

* Item frames 'work'

* Blocks in the item frames work

* Remove commented code

* Small changes

* More progress

* Whittling down

* Fix swords, etc

* NBT data implemented

* Remove unused import

* Add item frame item removing; add checks for removing item frames

* Add requested changes; clean up logic

* Add license

* Always delay item frame updates by 500 milliseconds

* Switch to per-session item frame cache

* Revert item translator refactoring
2020-05-02 15:44:05 -05:00
Camotoy b07161b0a9
Add block values + note block note graphics (#455)
* Add note block visual without note pitch

* Add rest of block value code

* Add rest of block value code

* Fix pistons, somewhat

* Remove note block attempt

* Re-add whitespace

* Simplify sendPacket of BlockEventPacket

* Add note block visual without note pitch

* Add rest of block value code

* Fix pistons, somewhat

* Remove note block attempt

* Re-add whitespace

* Add mappings for noteblock pitch

* Change noteblock pitch code

* Noteblock Pitch Attempt

* Commit with PistonBlockEntityTranslator

* Cleanup for PR

* Improve pistons

Co-authored-by: blazewalker462 <blazewalker462@protonmail.com>
2020-05-01 00:51:23 -05:00
RednedEpic 31be608038 Add block break sounds for blocks with 0 hardness, and refactor some things
The refactors in this commit go a bit beyond the scope of what the sound/effects branch was meant to accomplish, however most of these changes are necessary so chunk caching could be reintroduced for the standalone version. The chunk caching here allows for us to get the block ID before the block was broken, and in the future allow us to implement newer features. Chunk caching is optional (and disabled by default) as on non-Bukkit versions, it can eat up a lot of RAM with many players online.
2020-04-29 15:01:53 -05:00
Camotoy 94ecb2c6c7
Block entity rewrite (#382)
* Initial attempt

* Rewrite of the rewrite

* First working implementation

* Far better working implementation

* Clean up imports

* Remove commented code

* Cleanup code; change things

* Remove unused imports

* Cleanup code

* Add licenses; add comment

* More cleanup

* Clarifications

* It complained about a JavaDoc comment

* Update access permissions

* Switch from reflections to iteration over BlockEntityTranslators
2020-04-21 00:32:32 -05:00
OnlyBMan 3972cc7f87 Fix comments 2020-04-14 18:40:05 -04:00
OnlyBMan 08eb99fa94 Implement skulls and heads 2020-04-14 18:33:55 -04:00
DoctorMacc d547b31b38 Fix first load crashing; fix NPE 2020-04-10 16:36:41 -04:00
DoctorMacc 44a46d1872 Remove unnecessary code 2020-04-06 11:18:16 -04:00
DoctorMacc 81c9e4f165 Fix beds and signs 2020-04-06 11:16:16 -04:00
RednedEpic c13bbcda85 Fix null block entity console spam, which caused the world to be invisible
This was a rare bug that only happened on very few servers, and from what I gathered, only 1.8 servers using ViaVersion.
2020-04-04 17:22:54 -05:00
RednedEpic 392b0b5727 Merge branch 'master' into inventory 2020-04-04 03:12:23 -05:00
Redned ddf2f471ea
Merge branch 'master' into chunk-fix 2020-04-04 02:00:18 -05:00
RednedEpic e76b67265a Rebase 2020-04-02 17:53:45 -05:00
RednedEpic be9396f585 Merge branch 'master' into inventory 2020-04-02 17:01:17 -05:00
BuildTools 22908c4de7 Remove whitespace 2020-03-26 10:31:57 -04:00
BuildTools 545ab0f268 Move bed-specific code to BedBlockEntityTranslator.java 2020-03-26 10:22:44 -04:00
BuildTools 5301c8c3f6 Implement bed colors
Java Edition includes the bed color in the namespaced ID; in Bedrock edition it's one of the tag values as a block entity. This code involves creating a table between block states and bed color numbers and looking that up on chunk load or block update.
2020-03-25 22:03:46 -04:00
Ender 13a58dc825 Begin making translators annotation based
Also, rename TranslatorsInit to Translators; makes alot more sense.
2020-03-23 23:03:33 -05:00
RednedEpic 418026dbe6 Merge branch 'block-entities' into inventory 2020-03-05 20:00:14 -06:00
AJ Ferguson eaf45ff6f7 Fix chunk view position bugs on some servers 2020-03-05 16:26:36 -09:00
AJ Ferguson 9008036ee4 Merge remote-tracking branch 'remotes/upstream/master' into chunk-fix
# Conflicts:
#	connector/src/main/java/org/geysermc/connector/network/translators/block/BlockTranslator.java
#	connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaChunkDataTranslator.java
#	connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java
#	connector/src/main/java/org/geysermc/connector/utils/Toolbox.java
2020-02-10 17:38:56 -09:00
SupremeMortal f9cd88eaa2
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/direct-block-mapping
 Conflicts:
	connector/src/main/java/org/geysermc/connector/utils/Toolbox.java
2020-02-09 22:53:57 +00:00
SupremeMortal 9594b42523
Add waterlogging support 2020-02-09 22:06:22 +00:00
AJ Ferguson e4ab4b336c Chunk fixes 2020-02-05 19:32:33 -09:00
OnlyBMan 4dff067faa Add biomes 2020-02-05 21:10:34 -05:00
RednedEpic 0cf574ddcb Merge branch 'master' into feature/direct-block-mapping 2020-02-05 18:59:20 -06:00
RednedEpic e0f6c8a170 Fix chests and potentially other block entities 2020-01-25 23:51:29 -06:00
RednedEpic 6bb478bda4 Merge branch 'master' into block-entities 2020-01-19 22:35:33 -06:00
RednedEpic dc594ee22c Update license headers
Certain headers for classes that are to be removed (e.g. plugin api) were not updated to prevent merge conflicts.
2020-01-08 21:05:42 -06:00
RednedEpic da8bd8a659 Actually fix signs and start on campfire/container translators
Since signs are not sent as block (tile) entities in chunks when it comes to later Minecraft versions, caching and sending the signs after the chunk packet has been sent was the only way to fix this. Sign data sending has intentionally been delayed in JavaUpdateTileEntityTranslator in the event that a chunk takes a long time to send and the block entity data is sent first.
2019-12-30 21:55:17 -06:00
SupremeMortal 94851ef4b8
Move all block related code into BlockTranslator
It makes more sense.
2019-12-31 00:14:38 +00:00
AJ Ferguson 782feed641 Fix lighting when reloading world 2019-12-28 18:17:00 -09:00
AJ Ferguson b2f86ec20b Rewrite dimension code
New code does not rely on pausing the thread
2019-12-28 04:35:21 -09:00
RednedEpic e1ba1fa3e8 Merge remote-tracking branch 'origin/master' into block-entities 2019-12-23 13:49:20 -06:00