Commit Graph

85 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
David Choo 57c0185b45
Prevent projectiles from blocking the player's vision (#2472)
Prevent Snowballs, Eggs, and other throwable projectiles from blocking the player's screen
2021-08-17 22:44:33 -04:00
David Choo d7fbdaf93d
Fix Squid Animation (#2398) 2021-07-20 12:08:48 -04:00
Camotoy 32bbd8ae1c
Attribute rewrite
This commit solves a couple issues:
- Entities that don't implement LivingEntity don't need to bother with attributes
- We don't need to cache all attributes for every entity
- Mounted entities' hearts were inconsistent

No entity as of this commit caches their attributes except for the player entity.
2021-07-08 10:30:59 -04:00
Camotoy 35450f7b78
Implement entity shaking when freezing and more
- When freezing ticks is at 140 or more, entities will shake
- Implement skeleton and zombie conversion shaking
2021-06-18 19:09:18 -04:00
Camotoy 3835da288f
No need to cast here (thanks Konica) 2021-06-06 14:41:41 -04:00
Camotoy ef0503ede0
Properly implement freezing ticks 2021-06-06 11:36:11 -04:00
Camotoy 249f04441d
Set entity dimensions for goat long jumping 2021-06-04 22:26:29 -04:00
Camotoy b5307ab3ed
21w20a support 2021-05-19 22:24:11 -04:00
Camotoy 120769c7f6
Allow for crawling and moving in one-block spaces where possible (#1814)
This commit brings full support for crawling, sneaking under 1.5-block-tall spaces, and swimming in one-block areas. There is a check in place that decreases the player's speed to something comparable to Java if they are in a situation where they would otherwise go at normal walking speed (for example: without the check, a Bedrock player would go at full walking speed while crawling).
2021-04-12 00:35:53 -04:00
Camotoy f827b28852
More smoothed out shield code (#2051)
- Shield code is now down as the player is sneaking - it doesn't wait for the server to update our sneaking status
- Shield is now applied correctly when sneaking and then moving to the shield item
2021-03-18 00:53:14 -04:00
Camotoy 3d4fff8dee
Fix sleeping on older Minecraft server versions (#2049)
BED_POSITION is enough to trigger sleep.
2021-03-17 10:38:56 -04:00
Camotoy 6be71fc045
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-02-26 00:46:44 -05:00
Camotoy 9f5a356180
Armor stand fixes (#1270)
Armor stands now show armor if invisible. This allows both names and armor to show on an armor stand, and should allow for custom models that use armor stands to show, to an extent.
2021-02-25 12:54:30 -05:00
Camotoy 8317961340
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-01-01 14:20:52 -05:00
Camotoy 186d94917a
Update copyright to 2021 (#1772)
* Update copyright to 2021

Free commit!

* These don't need a copyright

* Don't downgrade the mappings
2021-01-01 10:10:36 -05:00
Camotoy 3c1a40c56a
Better net ID handling 2020-12-29 19:59:22 -05:00
DoctorMacc 049242db4b
Update to 1.16.200 2020-12-09 01:12:02 -05:00
rtm516 da2dc69441
Update MCProtocolLib to Adventure migration (#1572)
* Use raw message data instead of converting the message

* Update MCProtocolLib to Adventure

* Ignore MCProtocolLib Adventure depend

* Remove unused dependency

* Fix isMessage handling `null` wrong.

* Update to adventure 4.2.0

* Clean-up isMessage

* Fix tests

* Clean-up of catch statements
2020-11-27 18:28:08 -05:00
circuit10 a70d3e2150
Fix inconsistencies with movement and position (#699)
Movement is now significant better, especially on slabs, stairs, and other half-blocks.

Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: Tim203 <mctim203@gmail.com>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-11-20 14:56:39 -05:00
rtm516 512f8cd6c2
Rewrite message handling in MessageUtils to use Adventure (#1498)
* Rewrite message handling in MessageUtils to use Adventure

* Move to static Adventure commit to fix a bug

* Initial test implementation

* Add RGB downgrade test

* Move MessageUtils and rename

* Clean-up and fix tests

* Fixed sign and book content handling

* Fix blank signs causing NPEs

* Fix reset before message being stripped

* Add comment about the reset character

* Fix legacy style server motds

* Fix more messages being handled wrong

* Fix title packets being handled wrong

* Fix trailing formatting characters on the end of sign lines

* Add auto updating of Java locale files

* Add en_us locale updating and hash caching

* Changes to hash determining

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-16 23:57:57 +00:00
Camotoy e748240a02
Add more interactive tags (mobile buttons) (#1443)
* Add more interactive tags (mobile buttons)

This expands our support for showing the interactive tags on touchscreen and console setups. This is not complete - specifically, the food compatibility of creatures needs to be expanded upon (I will work on this later and does not stop this PR from being mergable). This also includes:

- Creepers who are ignited with flint and steel now show up properly
- Zombie villagers now shake properly when converting and show their region outfits

* Add more food choices and add more panda entity metadata

* Re-add eating flag

* Remove debug line

* Refactor dimension usage, finish interactive tag usage, bees

* Print statements... ._.

* Don't make eating item packet data a non-constant

* Move BAMBOO to ItemRegistry

* Add missing break

* Make changes

* Minor final changes
2020-11-11 19:28:45 -05:00
David Choo 4237503d6d
Fix laying crash (#1510)
* Fix crash with GSit lay and use Java bed position data

* Fix GSit's lay position

* Move Bed Position metadata to the right class

* Actually fix lay for PosePlugin

* Revert "Actually fix lay for PosePlugin"

This reverts commit 3f21261162.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-10 12:05:16 -05:00
Camotoy 045c0e0637
Introduce CommandSender.getLocale() (#1431)
* Introduce CommandSender.getLocale()

This allows Geyser-specific commands (e.g. `/geyser help`) to be displayed in the (Java or Bedrock) player's default language, which stops those commands from simply being displayed in the default locale.

* Tweak Javadoc

* Set CommandManager's GeyserConnector to final

* Clean up
2020-10-29 18:30:52 -04:00
AJ Ferguson 7f4b588cdf server inventory. WORK IN PROGRESS
wip commit of implementing server authoritative inventories. there is a lot of experimental and debug code. this is NOT ready for testing or review.
2020-10-16 15:25:05 -08:00
Camotoy b07433698a
Translate specific messages (#1161) 2020-08-16 19:02:59 -04:00
Arktisfox 54bee1f868
Small entity metadata fix, other player bow implementation (#685)
* Move blocking case to LivingEntity, and make other players bows animate.

This moves metadata ID 7 to LivingEntity, it's proper place. It also sets the 'USING_ITEM' flag which animates other players bows.

* Add skeleton aiming support

Skeletons don't have support of pushing their bows back on Bedrock, but this allows them to hold their arms up

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-07-30 22:10:55 -04:00
Camotoy a4339be212
Only send metadata update once per Java metadata packet (#1022)
While this doesn't fix any bugs, it may be a slight performance enhancement as we aren't sending multiple packets per one Java entity metadata packet.
2020-07-30 15:15:07 -05:00
DoctorMacc fe254380dc Clean up some TODOs 2020-07-08 12:36:26 -04:00
DoctorMacc 0cea703b46 Save ItemEntry classes for items 2020-07-07 16:40:19 -04:00
DoctorMacc a7fbe995f8 Add comment and check for null when removing passengers 2020-07-04 10:26:32 -04:00
rtm516 da96a5b19c Fix Strider cold state when riding and removing of the RIDING flag when a parent is killed 2020-07-03 22:55:54 +01:00
rtm516 a9bb8745f5 Fix Zombified Piglin fire flicker 2020-06-30 13:20:03 +01: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 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
Camotoy 7231758a19
Prevent swimming animation from appearing on older servers (#692)
The swimming animation could be played on older servers since that was a legacy value for using an item.
2020-06-10 17:52:36 -05:00
rtm516 5fca5d5ef5
Fix position of non-marker invisible armour stands (#697)
This adds the height of the armour stand to the position if its invisible and not a marker to counteract the scale being 0 therefore having a wrong nametag position
2020-06-03 21:12:16 +01:00
Camotoy 18891a22f1
Check for instance of TranslationMessage (#722)
Checks for class of custom name ID in case it's translation message.
2020-06-02 10:45:33 -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
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
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
Camotoy b4ecb88d49 Add air bubble UI support (#569)
This commit translates entity metadata ID 1 into the AIR entity metadata.
2020-05-15 15:29:54 -05:00
rtm516 c84c0f23cb
Fixed invisible flag not getting set back (#535)
* Fixed invisible flag not getting set back

* Fixed indentation
2020-05-11 23:44:30 -05:00
rtm516 324bc67c97
Fixed small armour stands not respecting invisibility (#533) 2020-05-11 14:56:50 -05:00
rtm516 f9ee569cd5
Various entity fixes (#529)
* Fixed invisible entities nametags being displayed

* Fixed most entity collision boxes

* Fixed area effect cloud not displaying

* Fixed armour stand size and marker

* Fix baby collision boxes

* Fixed squid animation (rotation still broken)

* Fix Guardian beam for local player

* Fixed armour stand invisibility

* Fixed Wither boss data

* Fixed  fishing line attach to entities
2020-05-11 00:09:16 -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
RednedEpic 6642f1ec26 Fix a few entities not showing up and include identifiers for entities in EntityType 2020-05-05 00:09:36 -05:00
RednedEpic 26266bf9b6 Fix black texture of offhand item (Closes #332) 2020-05-04 22:01:34 -05:00