Commit Graph

200 Commits

Author SHA1 Message Date
rtm516 b10e5d5af3
Clean copyright message and update all files (#1053) 2020-07-30 15:10:15 -05:00
AJ Ferguson 5b1116b15a
Creative items (#1013) 2020-07-24 15:42:15 -04:00
Camotoy 221e5bd103
Disconnect client if using an invalid Mojang account (#975)
This commit supresses the NPE that was previously sent when using an invalid Mojang account. Instead, the Bedrock client is disconnected with an error message.
2020-07-18 15:56:12 -05:00
DoctorMacc f68632f433 Block-related updates
- Fix block breaking animation
- Fix block breaking particles
- Don't initialize Geyser's chunk cache if using Spigot
2020-07-06 21:38:10 -04:00
RednedEpic 24f9651cc6 Convert map of players to list (may address #833) 2020-07-06 20:11:34 -05:00
AJ Ferguson 699402e635 Fix bug with maps 2020-07-06 15:52:38 -08:00
rtm516 cfaf4051b7
Add Translation support (#504)
Adds full multi-language support to any Bedrock-supported language.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-07-05 19:35:51 -04:00
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05:00
rtm516 f5da962f6f Fix disconnect message formatting 2020-06-28 23:38:27 +01:00
AJ Ferguson e3e8bb2799 Fix first item of creative inventory not showing 2020-06-27 20:47:10 -08:00
Tim203 8f763dfc5f
Move common stuff used only by connector and bootstrap to connector 2020-06-28 00:27:00 +02:00
DoctorMacc 75f470cb33 Fix creative items 2020-06-27 11:35:02 -04:00
DoctorMacc ea1a9e5427 Bedrock 1.16 updating part 1 2020-06-22 20:11:09 -04:00
DoctorMacc 117cdf282d Begin updating Geyser. Requires manual MCProtocolLib compile 2020-06-20 22:24:45 -04:00
DoctorMacc d6119375b2 (Incomplete) Update MCProtocolLib 2020-06-18 21:44:50 -04:00
Camotoy 9369b20209
Add 1.9+ PvP 'Cooldown' (#768)
* Add 1.9+ PvP 'Cooldown'

This commit adds a subtitle that acts as the Java cooldown. This is an optional feature disabled in the config with `show-cooldown`. This does not appear on plugins that use OldCombatMechanics.

* No need to bump up the config version; I was just tested with OldCombatMechanics

* Use simpler casting

* Use session variable of lastHitTime for theoretically better performance

* Reuse attribute value calculation from AttributeUtils

* Remove unused imports

* Revert config version update in config.yml
2020-06-16 19:03:28 -05:00
rtm516 a6f91d5e15
Fix maps not loading in sometimes (#758)
* Fix maps not loading in sometimes
Adds a default map ID so the map item isnt invisible on bedrock.
Respond to the MapInfoRequestPacket so the image loads on first join.

* Remove debug log

* Add comments
2020-06-15 14:24:52 -04:00
Heath123 6e127edfd6
Stop using TrigMath class (#753)
* Stop using TrigMath class

* Use MathUtils
2020-06-09 14:50:21 +02:00
Heath123 1da130ab07
Fix initial movement speed (#751)
Bedrock clients move very fast by default until they get an attribute packet correcting the speed.
2020-06-08 08:13:25 -04:00
DoctorMacc afb12e923b Show villager display name 2020-06-06 00:04:05 -04:00
DoctorMacc 4c5d80e2e9 Update to latest master 2020-06-05 22:52:11 -04:00
AJ Ferguson 3d357af739
Inventory Fixes (#602)
* Fix edge case when shift clicking an output slot

* Don't send window close packet if window is already closed

* Limit amount of window close packets sent to the client

Fixes hidden inventory bar bug

* Restrict user from unusable chest inventory slots

* Fix crafting table slot mappings

* Always send cursor update
2020-06-02 08:48:26 -08:00
Camotoy b8a3009c9d
Ignore all downstream packet errors (#693)
* Ignore all downstream packet errors

Instead of kicking the client off because of an error, we simply display a logger warning and suppress the error.

* If debug mode, print stacktrace
2020-05-30 17:31:20 -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 59da87a10f
Merge entity mounts branch to master (#589)
* Initial support for entity mounts*

* This only works for viewing other players on mounts/vehicles. Currently, mounting on vehicles through Geyser with bedrock does not work at all, though, you can see other Java players on mounts just fine.

* Fix Bedrock player mounting; add minecart offset

* Remove debug code

* Fix boat animation

* Remove debug code

* Add notice of possible steering flip

* Add translator for PlayerInputPacket

* Upload WIP code for BoatEntity.java

* Add animation for rowing on Bedrock side

* Clean up debug code, start on boat movement

* Add notice about flying horses

* Rename BedrockPlayerInputPacket.java to BedrockPlayerInputTranslator.java

* Delete BedrockPlayerInputPacket.java

* Use Translator Annotation again; Thanks to LegacyGamerHD

* Upload ineffective mount-on-login code

* Upload current changes with no debug code

* Change case where applicable

* Change Integer[] to int[]; Change schedule() to execute()

* Don't use Thread.Sleep() and instead call itself again

* Fix players not being linked on login/chunk load

* Little changes

* Minor improvements/fixes to boats

* Remove empty file

* Fix horse flying.

* Various entity mounting fixes

* Add mounting offsets for skeleton and zombie horses

* Another round of entity mount-related fixes

- Add offsets for skeleton and zombie horses (Thanks to tester DirtNasty)
- Boats can now be placed in survival (Thanks again to tester DirtNasty)
- Boats and minecarts can now shake

* Add translating for ServerVehicleMovePacket

* Cleaning up

* More cleaning up

* Add interactive tag support for mountable entities

* Boats move far more nicely

* Add horse heart visuals

* Update interactive tags

Co-authored-by: RednedEpic <redned235@gmail.com>
2020-05-23 16:39:17 -05:00
rtm516 fc6532732d
Adds skin ears from MinecraftCapes.co.uk + Clientside linked account skins + Elytra textures (#539)
* Added ears geometry support

* Added ear fetching from mc capes

* Added support for deadmau5

* Commented, documented and cleaned code

* Allow bedrock players to see their java skin/cape/ears when joining

* Optimised Imports

* Fix missing else statement

* Moved ears and fixed elytra skins

* Added ears config option

* Fixed cape/elytra transparency

* Fixed slim skin geometry

* Fixed async ears request and added alex skin

* Fixed default elytra not showing with no cape

* Moved to normal Base64 functions

Co-authored-by: James Harrison <james@fasttortoise.co.uk>
2020-05-23 16:06:34 -05:00
AJ Ferguson 2366559694 Store villager data in the player and fix wandering trader 2020-05-19 09:41:44 -08:00
AJ Ferguson e2d46c3d49 Work on villager trading 2020-05-18 21:15:29 -08:00
RednedEpic b0d0c168d2 Fix bossbar causing players to be unable to break blocks or interact in small areas (Closes #537) 2020-05-17 01:06:07 -05:00
RednedEpic 30e38b3a2f Add basic villager trading support (incomplete)
This commit implements basic functionality for villager trading. This is still incomplete and is buggy in areas such as with villager trades that have more than one input and trade inputs and outputs containing NBT.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-05-16 23:52:39 -05:00
rtm516 0c60af66b2
Fixed customised skins causing strange display (#534)
* Fixed customised skins causing strange display

* Cleaned up floodgate player checking

* Fixed cape scale

Co-authored-by: James Harrison <james@fasttortoise.co.uk>
2020-05-11 23:45:16 -05:00
rtm516 5ae95433e5
Bedrock to Bedrock legacy skin support (#276)
* Added legacy skin support for bedrock to bedrock clients

* Added bedrock to bedrock cape handling

* Added bedrock geometry support

* Bedrock skins now work in all auth modes

* Tonne of debug info

* Added fix to prevent customised skins from being loaded

* Added skin size to bedrock client data

* Cleaned debugging code

* Made bedrock cape take priority over third party

* Cut the customised skin image in half to hopefully get it to map

* Removed hacky conversion attempt

* Fixed bedrock skin caching on load and 1.14.60 support

* Cleaned up debug messages

* Added linked player ignore
2020-05-06 16:50:01 -05:00
Camotoy 48147c2ce3
Fix Floodgate players causing errors on Bukkit. (#490)
Co-authored-by: Tim203 <mctim203@gmail.com>
2020-05-05 12:53:25 -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
ForceUpdate1 d0a2f6ac27
Fix movement issues #466 (#473) 2020-05-04 01:06:08 -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
RednedEpic ad596cdccb Add sound handlers for block interaction
These sound handlers had to be added since on Minecraft: Java Edition, these sounds are handled clientside whilst Minecraft: Bedrock Edition expects something from the server. To counter this, we emulate the sounds of that on Minecraft: Java Edition within Geyser and send it to the client. The code may seem a tadredundant, but there is not much of an alternative unfortunately.
2020-04-30 00:21:02 -05:00
RednedEpic 1fbb755d26 Merge branch 'master' into sound-master 2020-04-29 15:14:25 -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
rtm516 bea070395f
Handle player teleports properly (#389)
* Handle player teleports properly

Co-authored-by: ForceUpdate1 <mneuhaus44@gmail.com>

* impl teleport cache

* impl teleport cache

* removed debugs

* Cleanup

Co-authored-by: ForceUpdate1 <mneuhaus44@gmail.com>
2020-04-29 11:06:25 -05:00
RednedEpic c22eb170ec Merge branch 'master' into feature/sounds 2020-04-26 00:26:14 -05:00
RednedEpic 08b7857292 Remove unused imports in GeyserSession 2020-04-26 00:24:06 -05:00
rtm516 257918904b
Fixed spawn egg colours not loading in (#429) 2020-04-25 23:55:06 -05:00
Camotoy 0caecf68db
Only add entity to entity cache if ID doesn't exist (#428) 2020-04-25 23:54:42 -05:00
RednedEpic 497825dd96 Fix NPE in console when a sound was missing and clean up nesting 2020-04-25 18:23:01 -05:00
RednedEpic 61587ec320 Use Int2ObjectMap in InventoryCache and JavaServerDeclareCommandsTranslator 2020-04-25 17:56:19 -05:00
RednedEpic 8b487df698 Properly remove players from Geyser playerlist (Fixes #421 2020-04-25 17:53:35 -05:00
RednedEpic 79185fabb5 Only send block sounds when a block is being placed
Previously, any time a block was clicked whether it be with a block in the hand or not, a sound would play. This checks if the item in the players hand is indeed a block as well as the same block in the UpdateBlockPacket, and properly plays the packet.
2020-04-23 01:01:33 -05:00
DoctorMacc b0a8b9219a Add effects support and block break particles/place sounds
Co-authored-by: RednedEpic <redned235@gmail.com>
2020-04-22 23:40:49 -05:00