Commit Graph

586 Commits

Author SHA1 Message Date
AJ Ferguson e77f2b5dbb Drop long array nbt tag when translating to bedrock 2020-06-29 10:59:51 -08:00
DoctorMacc f2f59e4e37 Fill in renamed villager trading values (villager trading UI now opens) 2020-06-28 23:44:38 -04:00
AJ Ferguson 12d5982c57 Anvil fixes 2020-06-28 16:14:57 -08:00
AJ Ferguson c2c64fd1cf Fix some recipes with multiple ingredient options 2020-06-28 13:33:38 -08:00
RednedEpic 8e8bc2817a Return if sound is null and update mappings 2020-06-28 12:35:17 -05:00
rtm516 9569416124 Fix chat formatting and team colors 2020-06-28 14:57:41 +01:00
DoctorMacc 6e94428f60 Non-working smithing table inventory support 2020-06-28 01:53:35 -04:00
Tim203 8f763dfc5f
Move common stuff used only by connector and bootstrap to connector 2020-06-28 00:27:00 +02:00
AJ Ferguson ba9129129c Quick inventory fixes. WIP
Temporary. The inventory system will be rewritten very soon.
2020-06-26 18:51:09 -08:00
rtm516 17a1e82eca Add closest color mapping for RGB chat colors 2020-06-26 23:33:38 +01:00
DoctorMacc 54f6fada12 Remove try/catch from BlockTranslator and ItemTranslator 2020-06-26 11:15:21 -04:00
DoctorMacc 6f2bf659a9 Update JavaEntityEquipmentTranslator for Java 1.16 2020-06-25 21:53:51 -04:00
DoctorMacc bb630dc867 Update PotionMixData 2020-06-25 12:03:20 -04:00
DoctorMacc 06fa0de793 Add translator for PacketViolationWarningPacket 2020-06-25 11:16:36 -04:00
DoctorMacc 71aada1df3 Fix dimension switching; add static references to new Java dimensions 2020-06-24 20:27:27 -04:00
AJ Ferguson f0aaebc0ec Bump block state version 2020-06-24 14:14:20 -08:00
DoctorMacc b34dc05c1d Uncomment JavaDeclareCommandsTranslator and update 2020-06-24 12:16:30 -04:00
DoctorMacc 78df56c7a0 Update for 1.16.1 2020-06-24 11:14:11 -04:00
DoctorMacc 0471fa89f4 Bedrock 1.16 updating part 2 (Doesn't work) 2020-06-22 21:21:42 -04:00
DoctorMacc ea1a9e5427 Bedrock 1.16 updating part 1 2020-06-22 20:11:09 -04:00
DoctorMacc 56f9330a2d Remove ServerSpawnWeatherEntityPacket 2020-06-21 19:22:59 -04:00
DoctorMacc 63244ade53 Rename Geyser-Bukkit to Geyser-Spigot 2020-06-21 16:27:42 -04:00
DoctorMacc 427f4ef83d Merge master into Spigot rename 2020-06-21 16:21:47 -04:00
DoctorMacc 117cdf282d Begin updating Geyser. Requires manual MCProtocolLib compile 2020-06-20 22:24:45 -04:00
DoctorMacc 1015b830ce Merge branch 'master' of https://github.com/GeyserMC/Geyser into mcprotocollibupdate 2020-06-20 17:50:00 -04:00
Camotoy 100d7b7759
Add villager interactive tag (#788)
* Add villager interactive tag

This adds a button/controller guide for villager trading, if the villager is able to trade.

* Use a broader variable for metadata
2020-06-20 13:44:40 -04:00
rtm516 47cadc7689 Fix json data in chat 2020-06-19 19:29:01 +01:00
DoctorMacc 65f61ec703 Finish block state changes 2020-06-19 09:06:29 -04:00
rtm516 ad4c1ff0c7 Update Message system 2020-06-19 11:57:34 +01: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
Camotoy 256c62ce88
Entity (mostly rotation) fixes (#675)
* Entity (mostly rotation) fixes

    This PR adds:

    - Pig health displaying. Doesn't fix pigs being able to be controlled
    - Entity rotation is *mostly* correct. Villagers and sitting cats still seem to be odd but the ender dragon works great.

* Remove debug line

* Abstract rotation updating to functions per-entity

* Don't include changes from other projects

* Minor improvements

* Make updateRotation and updatePositionAndRotation cleaner

* Javadoc
2020-06-16 18:58:06 -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
DoctorMacc cc3b4c3eda Merge latest master; copy over old Geyser-Bukkit configs 2020-06-11 16:39:29 -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
rtm516 a5eba85880
Add ServerPlayerListDataPacket to ignored packets (#755)
This packet handles the header and footer of the scoreboard, therefore this does not exist in bedrock.
2020-06-10 17:52:07 -05: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 1d8995efe6
Add minimum delay between closing and opening a new window (#735)
Should fix new windows not showing up with some plugins like Lottery.
2020-06-04 14:49:32 -04:00
rtm516 5eef265f80
Fix display of some more entities (#726)
* Fix display of Evoker and Evoker Fangs

* Fix spawner minecart display

* Centeralise custom blocks for spawner and furnace minecarts

* Add comment explaining class
2020-06-02 18:16:04 -05:00
rtm516 a91eaa7821
Add item name translation (#559)
* Added item name translation

* Change to more appropriate NPE catch

* Remove whitespace

* Switch from try/catch to null checking

* Update mappings

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-06-02 16:33:37 -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
rtm516 ac5ab229f9
Fix Ender Crystal collision and explosion effects (#716)
Fixed the collision box being non-existent for ender crystals and fixed explosion effects not being displayed properly
2020-06-01 15:57:27 -04:00
rtm516 b8615874f9
Add furnace minecart (#712)
Adds the display of the furnace minecart, functions as expected.
2020-05-31 21:46:36 -04:00
Camotoy 64e3204611
Implement translator for AdventureSettingsPacket (#691)
* Implement translator for AdventureSettingsPacket

The AdventureSettingsPacket is translated into ClientSettingsPacket so the MAY_FLY and FLYING flags are sent to the server. This fixes double-jumping on some servers that rely on the client sending their flying information through this packet.

* Remove top-secret code analysis
2020-05-29 18:56:21 -05:00
Heath123 5c8f6eb184
Fix relative teleports (#688) 2020-05-29 15:11:38 -04:00
rtm516 3f76ae1d48
Add ignore for ServerKeepAlivePacket (#664)
This packet is already handled by MCProtocolLib for us.

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-05-28 11:43:31 -04:00
rtm516 1a92f6974c
Add byte conversion to allow int NBT values for Fireworks (#681)
Firework NBT data might be either an int or byte and bedrock only takes it as a byte.

Co-authored-by: Arktisfox <65837019+Arktisfox@users.noreply.github.com>
2020-05-28 11:38:23 -04:00
DoctorMacc 2dc755ca98 Rename Geyser-Bukkit to Geyser-Spigot
Despite the Bukkit suffix being correct in terms of the API, the name causes some people to download CraftBukkit instead of Spigot or Paper. All internal references to Bukkit have been renamed to Spigot.
2020-05-26 10:05:25 -04:00
Camotoy 14fcd77925
Fix entities stacking on top of each other when mounted (#660)
The offset was being called but not properly saved to a variable. The check will also not apply if there is only one mounted entity.
2020-05-25 22:43:29 -05:00
bundabrg a929c411d2
Use authData UUID when sending playerlist packets to the client (#654)
Bedrock knows its own UUID and when it receives the Java uuid it will either crash (MCEE) or add a ghost player onto the playerlist (Bedrock).
This change will check if an entity is the client and if so replace the entities UUID with the AuthData UUID.

A refactor of JavaPlayerListEntryTranslator was also done as I got confused each time what it was doing so it is now hopefully a bit clearer and also fixes the case where an entity is removed but still exists on the server (Vanished).
2020-05-25 22:39:57 -05:00
bundabrg cc6c7fe78d
When spawning don't add the player offset (#655)
Fixes falling when logging in
2020-05-25 22:35:26 -05:00
Arktisfox 0178492b59
Fix some book translation failures (#661)
Book pages can be sent as plain text rather than JSON. The text library doesn't use lenient parsing, so this fails, and the book isn't visible in the inventory.

This will convert the text into JSON if it's not already, before feeding it to the text library.
2020-05-25 21:19:37 -04: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
RednedEpic 7154e1c816 Strip Minecraft identifier when playing non-mapped sounds to allow for bedrock-exclusive sounds to be played 2020-05-24 14:56:05 -05:00
rtm516 3a39e9afee
Added Crossbow nbt translator (#590)
They still infinitely reload but they correctly track if they have data in now.
2020-05-24 15:51:30 -04:00
RednedEpic 0215220ac1 Fix spectator mode 2020-05-24 14:46:36 -05:00
RednedEpic 56d84c24d3 Reduce nesting in item nbt translators 2020-05-24 14:21:06 -05:00
RednedEpic 6dabc22d22 Add null check for fireworks tag (Closes #636) 2020-05-24 13:20:38 -05:00
RednedEpic 286970676b Add null check for shield code (Fixes #644) 2020-05-24 13:06:25 -05:00
RednedEpic 681cbeeae5 Add armor stand entity offset (Fixes #627) 2020-05-23 22:45:34 -05:00
Camotoy fe6257bb38
Check if firework item explosions tag is null (#626) 2020-05-23 21:16:11 -04:00
RednedEpic 0574feb87e Fix block breaking animations when in water (Closes #494) 2020-05-23 18:29:11 -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 d8d9fb7190
Fireworks! (#579)
* Fixed firework entity

* Added firework item translator

* Fixed mappings submodule
2020-05-23 16:33:39 -05:00
Camotoy 22a1073e54
Debugging improvements (#585)
* Debugging improvements

- Added an ObjectArrayList of packets we don't anticipate ever translating. Currently only holds ServerUpdateLightPacket which we don't use and probably don't need.
- Only print debugging logs from sounds if they failed to play.

* Add space
2020-05-23 16:11:54 -05:00
Camotoy 714c450291
Add players able to sleep in beds (#575)
* Add players able to sleep in beds

This commit sets the correct metadata and flags when the Java pose changes to sleeping.

* Player view while sleeping now works

* Fixed bed offset for other players
2020-05-23 16:09:11 -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
rtm516 8f01221275
Updated to support latest MCProtocolLib (#623)
* Updated to support latest MCProtocolLib

* Cleaned up names and imports

* Fixed minecarts

* Fixed throwables

* Fixed tnt
2020-05-23 15:56:49 -05:00
OnlyBMan 81d3b0ef10
Fix painting rotation (#597)
* Fix painting rotation

* add comment and spacing

* Dont sleep everything :P

* Fix whitespace

* Remove whitespace

* Fix underlying issue

Instead of adding a delay, exclude Painting in HeadLookTranslator.java. Thanks AJ!

* Remove unneeded import

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-05-21 18:45:35 -05:00
Camotoy a7f363ec09
Add option for disabling command suggestions; add config version (#598)
* Add option for disabling command suggestions; add config version

This commit adds an option for disabling command suggestions. If enabled, command suggestions will not be sent to the server so as to remove command freezing. This commit also adds a config version variable so users are notified when to regenerate their configs.

* Rename GeyserConfiguration.checkGeyserConfiguration()
2020-05-20 22:43:22 -05:00
Camotoy 1395b719cb
Add missing break to JavaEntityStatusTranslator (#600) 2020-05-20 10:12:31 -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 95297e4047 Update villager xp while trading 2020-05-19 07:28:33 -08:00
AJ Ferguson e2d46c3d49 Work on villager trading 2020-05-18 21:15:29 -08:00
Camotoy fd36930502
Add entity event for drowning. (#588)
This commit translates Java's LIVING_DROWN entity status to Bedrock's HURT_ANIMATION.
2020-05-18 22:26:27 -05:00
Camotoy 31d3d2e289
Add some elder guardian properties (#586)
- Adds the ELDER flag to all elder guardians, so they look like elder guardians and not giant regular guardians.
- Translates AFFECTED_BY_ELDER_GUARDIAN in JavaNotifyClientTranslator to add the elder guardian curse event.
2020-05-17 23:35:26 -05:00
rtm516 405ffb2666
Added mob spawner block entity data (#587) 2020-05-17 23:35:01 -05: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
rtm516 95b7055c10
Added map icons (#572)
* Added map icons

* Cleaned up and moved to enum
2020-05-16 23:58:00 -05:00
Camotoy 563cde2ade
Switch to client's translation for jukebox song name. (#573)
Just for consistency with the other part of the code.
2020-05-16 23:57:34 -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
Camotoy 1b260c16d7
Leash fixes (#567)
* Leash fixes

- Adds visuals for leash string by translating ServerEntityAttachPacket
- Updates position offset for lead knots, making them properly appear on fences

* Add basic description of JavaEntityAttachTranslator
2020-05-15 12:50:34 -05:00
rtm516 2830756a55
Fixed unusable space being off by 1 (#561) 2020-05-15 11:08:44 -05:00
rtm516 919af5203d
Fix banner items loosing patterns in inventory (#560) 2020-05-14 19:41:42 -05:00
Camotoy d5c14921e9
Add message when playing record (#549)
It appears that the record message is client-sided in Java Edition, so this sends a message whenever a record is played in-world.
2020-05-13 16:08:52 -05:00
Camotoy 64bfad2af9
Use Bukkit methods to send block sound (#522) 2020-05-10 15:25:28 -05:00
Heath123 720ae3c92d
Add survival-style block pick support (#526)
* Add survival-style block pick support

* Add BedrockBlockPickRequestPacketTranslator.java

* Remove unnecessary println

* Edit styling and add null check

* Fix compile error

* Remove nesting and unnecessary check

* Further reduce nesting

* Change 1-line statements and add missing comment

* Fix creating translator

* Fix imports
2020-05-10 15:05:51 -05:00
Camotoy 34d4817795
Add visual support for double chests (#523)
* Add visual support for double chests

* Update mappings submodule
2020-05-10 14:26:00 -05:00
RednedEpic e58ffdd3c0 Add support for block break animations from java players to bedrock 2020-05-08 00:18:05 -05:00
James Harrison 2355c503c9
Enderchest and Invisible Players fix. (#506)
* Fix EnderChests not showing on legacy servers (Hypixel)
Fix NPCs/Players sometimes being invisible

* Remove unused import

* Fix standard
2020-05-07 21:49:44 -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 4c1dae6714
Add unusable inventory space message (#492)
* Add unusable inventory space message

* Remove unused imports

* Fixed barrier pickup (#1)

Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2020-05-06 16:05:03 -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
rtm516 96a7770c22
Fixed entity bugs introduced by 6642f1e and added fishing lines (#483)
* Fixed entity bugs introduced by 6642f1e

* Fixed fishing line not displaying

* Clean extra line and added todo
2020-05-05 10:48:01 -05:00
RednedEpic 20bbbee3eb Remove flower pot debug code 2020-05-05 00:10:23 -05:00
James Harrison 5b3e7c965f
Chat/Skin fixes (#480)
* Made MessageUtils mimic java chat behavior
Send ClientSettingsPacket when player joins a server

* Fix comments
Set use client locale instead of hard coding

* Moved chat reset to fix some broken formatting

* Revert MessageUtil as rtm516 has implemented a better fix
2020-05-04 21:32:37 -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
ForceUpdate1 d0a2f6ac27
Fix movement issues #466 (#473) 2020-05-04 01:06:08 -05:00
RednedEpic 7d67b65777 Merge branch 'master' into feature/sounds 2020-05-04 00:51:22 -05:00