Commit Graph

156 Commits

Author SHA1 Message Date
chris 63fd97ab32
Fix: Crashing due to custom bows/crossbows/tridents (#4421)
* initial stab at fixing crashing due to removal of the chargeable component

* remove hardcoded animation
2024-02-07 18:17:51 +01:00
Kas-tle e6636ec9fe
Weapon component is deprecated (#4417) 2024-02-07 06:15:36 -08:00
chris 19a3dc3c4b
Support Bedrock 1.20.60 (#4415)
* Start on 1.20.60 support

* fix dimension switching

* Fix custom item icons... thanks mojang

* fix custom blocks/custom skulls breaking all block mappings

* - replace 10000 with static final variable

* fix: creative items not being found

* versioned custom item registration

* fix compression level setting
* show 1.20.61 as supported
2024-02-06 20:11:17 +01:00
chris f555dc0a92
Feature: Camera/Input locking API (#4332)
Adds API methods to control player cameras - including fancy transitions,  color fades, or simple input locks.
2024-01-31 11:21:06 +01:00
Konicai d3a4b13364 cleanup 2023-12-14 21:31:14 -05:00
Konicai e2062dd182 Reimplement support for 1.20.40 2023-12-14 21:31:14 -05:00
Konicai c7da8fe163 Better nullability annotations/handling for ItemStacks 2023-12-14 21:31:14 -05:00
Konicai f38d82c19c Drop <1.20.50 2023-12-14 21:31:14 -05:00
chris 95d65350e4
Project wide syntax/annotation cleanup (#4238)
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
2023-12-05 18:54:42 -05:00
chris 11945db7a0
Clear mob spawners if the Java server so requests (#4232)
* Clear mob spawners if the Java server so requests

* Empty spawners by replacing the spawner block with a new one instead of adding an invalid identifier to them.
Unfortunately, sending one UpdateBlockPacket that replaces the spawner does not work, we need to set the spawner to air first. Cool. But at least we don't summon particles for all empty spawners now

* store position vector (address review by @konicai)

* remove empty line
2023-12-01 10:27:42 +01:00
chris 44174fdc04
Add 1.20.50 Bedrock support (#4296)
* Start on 1.20.50

* Add 1.20.50 block_palette.1_20_50.nbt, creative_items.1_20_50.json and runtime_item_states.1_20_50.json

* fix stone and planks mappings

* add and do something with the new SetPlayerInventoryOptionsPacket

* Add readme version bump

* Cleanup/Explain the new BedrockSetPlayerInventoryOptionsTranslator
2023-11-21 23:31:56 +01:00
chris f40ca2004e
Add ability to set molang tags for custom items (#4041)
* Start on custom molang tags with custom items

* geyser_custom instead of geyser item tag

* Address reviews, add custom namespace ("geyser_custom") to tags

* use isBlank() instead of isEmpty()

* More efficient item tag setting
Co-authored-by: Konicai <71294714+konicai@users.noreply.github.com>

* tags instead of temp

* Merge in master, adapt to changes in the MappingsReader, delete unused ToolBreakSpeedsUtils class

* oops

* clean diff

* Change namespace from `geyser_custom` to just `geyser`

* Don't force a namespace at all; just like blocks don't

* Tags for items are now, as blocks, NonNull. Additionally, calling the .tags() builder multiple times will not add both sets of tags, but replace the existing tag set

* Remove @NotNull usage in favor of @NonNull

* Allow setting null for tags, but ensure that .tags() is always non-null

* Fix nullable annotation on tags method in the builder interface
2023-11-09 08:44:13 +01:00
Konicai 8173917623 Merge remote-tracking branch 'upstream/master' into feature/1.20.40 2023-10-24 10:37:28 -04:00
chris b4290d5be4
Versioned potion mappings (#4239) 2023-10-24 01:41:02 +02:00
Konicai 647a73d9f6
Support 1.20.40 connections 2023-10-19 01:11:59 -04:00
Kas-tle 89d7225c54
Fix API Registration of Custom Block Overrides (#4178)
* Api reg vanilla blockstate overrides; Closes #4177

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* proper case non static

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Clear queue when done

---------

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
2023-10-04 09:56:47 -07:00
Konicai c2cd99c829
Support Java 1.20.2 (#4112)
* Initial pass for 1.20.2, compiling
* Remove unused level events
* handle null GameProfile in ClientboundPlayerInfoUpdatePacket
* Handle level events BRUSH_BLOCK_COMPLETE and EGG_CRACK
* Account for null tag in DecoratedPotBlockEntityTranslator
* Explicitly show that 1.20.31 is supported
2023-09-29 17:14:49 -04:00
chris ae983779ba
Fix: Don't allow client side gamemode changes even if rogue plugins send a level 4 op permission... (#4148) 2023-09-25 22:54:23 +02:00
Valaphee The Meerkat dead91b929
Set BlockMapping.AIR (#4135)
* Set BlockMapping.AIR, id is always 0, but this also ensures that the palette always has air

* Rename BlockMapping.AIR to DEFAULT, as it does not have to represent AIR, and statically set it
2023-09-20 06:52:37 -07:00
Konicai 9a8015e8b6
Support Bedrock 1.20.30 (#4115) 2023-09-11 22:22:50 -04:00
Camotoy c67d50c13e
Some formatting fixes and creative menu fix 2023-09-09 13:23:19 -04:00
chris 806ec35a84
Feature: Allow client-side "game settings" menu gamemode/difficulty changes (#4062)
Removes difficulty/Gamemode settings from the custom server settings form since these are now present in the client side settings.
2023-09-09 00:34:19 +02:00
Valaphee The Meerkat 54bb1f3d13
Remove blockstate version (#4011)
* Remove blockstate version

* Regr, add comment why version tag is removed
2023-09-06 11:19:51 -07:00
Kas-tle bf81fc1139
Allow Null Texture for Block Mappings/API (#4094)
* Allow null textures for blocks.json use

* Missing semicolon
2023-08-31 10:09:14 -07:00
Konicai d4ae428225
Drop support for 1.19.80 (#4091)
* Initial removal of any 1.19.80 logic
* Re-add isPre1_20_1 method
2023-08-29 16:58:51 -04:00
Kas-tle 9ddfdf9374
Add support for custom blocks and skulls (#3505)
* Super cursed custom skulls custom block

* Rename some stuff

* Attempt to clean up some code

* Remove skull translation events and define custom blocks for custom skulls

Clean up skull block translation a bit

* Auto generate skull resource pack

Change `davchoo` to `geyser` in geometry

* Add config options for custom blocks and custom skull blocks

* Fix formatting and names for player skulls

* Use block states more efficiently for custom skulls

21 block states vs 48 block states

* Clean up custom block api a bit

* Apply some suggestions from Camotoy

* Move custom skull config stuff to its own file

Custom skulls can now be added by username, uuid, and textures

Move skull nbt stuff from requestTexturesFromUsername to
SkullBlockEntityTranslator
Add requestTexturesFromUUID

* Update custom block nbt for v534

* Disable collision box & selection box when box is empty

Fix incorrect collision names used in CustomBlockComponentsBuilder

* Add custom block stuff to provider registry loader

* More API changes

Convert CustomBlockPermutation into a record
Change materialInstances in CustomBlockComponents Builder to
materialInstance
Reuse box components in CustomSkull

* Convert skull floor geometries into a template

Should be easier to modify in needed in the future.

* Crop and reorder skull textures to eliminate unused space

Should reduce memory & storage usage for Bedrock clients

* Revert "Crop and reorder skull textures to eliminate unused space"

This reverts commit 15fd5353e1.

* Use identifier from CustomBlockData in SkullResourcePackManager

* Fix isIncorrectHeldItem check for custom skull blocks

Add defaultBlockState to CustomBlockData

* Fix adding duplicate block states for custom blocks with 0 properties

Remove defaultBlockState CustomBlockState field from
GeyserCustomBlockData since it creates a circular reference

* Add basis for overriding Bedrock block states

Fix missing providers when used in GeyserDefineCustomBlocksEvent

* Fix custom blocks in 1.19.50

* Decouple mappings from items

* Decouple mappings from items

* Null check

* Move to CustomBlockRegistryPopulator

* Remove name_hash from blocksTag/vanillaBlockStates

Fixes creative inventory contents with custom blocks registered

* Limit Bedrock versions to 1.19.40+

Custom blocks were released in 1.19.40

* Un-revert Crop and reorder skull textures to eliminate unused space

Should reduce memory & storage usage for Bedrock clients

Bug with top face flipping + per-face uv's was fixed in 1.19.40+
https://bugs.mojang.com/browse/MCPE-160073
Geometry is still offset by 0.5 to prevent lighting bugs

* Add validation custom block components and s/lightFilter/lightDampening/

Also validate custom block names

* Add display name component and add toggle for client block placing

The display name component allows blocks to use other locale keys.
placeAir will prevent the client from placing the default block state.

* Begin parsing block mappings (still much to do!)

* CustomBlockMapping stores block w/ all states

* Mappings almost :/

* Ok now they work at least

* Read most mapping components

* Block mappings mostly done

* Translate block item

* Add docs for custom blocks

* Add tags

* More docs

* Accidentally added name comp.

* Fix collide box and warn for >16 props

* add registerBlockItemOverride event + refactor

* Inventory overrides for multistate bedrock blocks

* Implement all remaining block components

* Minor cleanup and javadocs

* Update custom skull config example

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix light_emission and light_dampening components

* Remove redundant populate method and remove BLOCKS_JSON after last use

* Fix inventories with block state overrides not opening

* API event for skull blocks & let register via URL

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use skin hash instead of URL

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Rework MappingsReader_v1 to avoid passing maps around

* Treat all properties as string properties

There isn't a real need to check for boolean and int properties

* Fix block registry scan in MappingsReader

* Skin hashes can have less than 64 characters?

* Include entry when logging exceptions from block mappings

* Submodule

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix block break speeds thanks to @Camotoy

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Temporarily fix build on eclipse so I may work...

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Custom tool breakspeed by server; Closes #3348

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Account for if custom skulls are added on 1st run

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Initial framework for extended collision boxes

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Add some notes for the extended collision box impl

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* We have our extended collision registry

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Notes for me

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes almost work

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes actually work

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Consider all hitboxes in calculation

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* X is mirrored...

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes are much improved

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Upstream fallout

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Redned235's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Oops my bad that makes no sense :)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Ext collision box chunk translation optimization

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Trunc skinhash to 32 chars due to 80 char limit

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use new transformation cmpnt vs legacy rotation

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* keep arr null on get extcolstor

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Properly handle if extended collision box is below

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Less ugly (realized it can go here)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Prevent 2x placement due to extended collision box

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Properly build on eclipse via indra

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Ensure enough bits in bedrockData for paletteIDs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix not needed whitespace

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update license headers to 2023

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use release indra over snapshot

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Revert "Update license headers to 2023"

This reverts commit f750059e8e.

* Account for collisions in chunk section y0 layer

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix extended collision @ air section bottom

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @rtm516's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* More @rtm516's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update javadocs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Lock extended collision to section

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Clear ext col even when air

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Let override vanilla items in creative inventory

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Avoid creating 12 HashSets for every overrided block state

* Super minor nitpicks + Custom Skull NBT fix

* Check custom skull is within Bedrock bounds

Fixes NPE with custom skulls above y=320 or below y=-64

* Add static builder methods to match CustomItemData API

* Upstream

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Initial API setup for modded blocks (no impl yet)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* More work on nonvanilla blocks (nonfunctional)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix compile

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update submodules

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Modded reg so far (not done)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Add non-vanilla registration and fix a few bugs

* Fixes for non-vanilla blocks

* Remove import

* CustomRegPop. go1st for now; must split for modded

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address silent change to geo component for blocks

Co-Authored-By: Unoqwy <pm@unoqwy.dev>
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Seperate bedrock, vanilla, & nonvanilla block reg

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Single event

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Impl MaterialInstance as builder per @Redned235

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Added creative category enum & added some missing overrides (#7)

* Add material instance to provider registry

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* oops

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix case of correctBedrockIdentifier not found

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix docs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address review from @davchoo

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Set namespace of custom blocks vs ident direct

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address review from @rtm516

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* One more

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Remove rogue space

* Geo component as builder

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* use super name

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Bump version

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

---------

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: davchoo <davchoo@users.noreply.github.com>
Co-authored-by: davchoo <4722249+davchoo@users.noreply.github.com>
Co-authored-by: Unoqwy <pm@unoqwy.dev>
Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: ImDaBigBoss <67973871+ImDaBigBoss@users.noreply.github.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2023-08-21 16:04:08 -07:00
chris 706d1b9627
Fix smithing tables on pre-1.20 servers (#4056) 2023-08-16 22:42:17 -04:00
chris 340be2d8a4
fix observer mapping (#3970) 2023-07-12 13:21:29 -04:00
Konicai 3a0c1b788a
Support for 1.20.10 (#3961)
Co-authored-by: chris <github@onechris.mozmail.com>
Co-authored-by: RednedEpic <redned235@gmail.com>
2023-07-11 18:17:01 -05:00
Konicai b344e21f7f
Fix loading contents keys of encrypted resource packs (#3925) 2023-06-29 12:22:13 +01:00
Konicai cdd0459d47
Implement interaction entity (#3916) 2023-06-26 12:04:28 -04:00
Konicai 2368b63ad5
Allow deferred registries to be loaded/set more than once (#3892) 2023-06-18 17:45:25 -04:00
chris 903e61f1a3
Exposing resourcepack loading to api (#3696)
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
Co-authored-by: RednedEpic <redned235@gmail.com>
2023-06-16 20:39:53 -05:00
Konicai 6eca6ade06
Loop through item palette versions in ascending order (#3884) 2023-06-16 20:51:29 -04:00
Redned b78ca431b6
Merge pull request #3817 from GeyserMC/feature/1.20 2023-06-07 10:47:44 -05:00
RednedEpic 13c9063368 Update to use protocol 589 and other 1.20 updates 2023-06-07 09:44:18 -05:00
Konicai a9d64de070 Support for v588 client and mappings 2023-05-24 16:37:16 -04:00
Konicai f712d4dd81 Bump Protocol and update imports of org.cloudburstmc.protocol.bedrock.data.definitions 2023-05-23 16:34:50 -04:00
rtm516 178fb2136f
Allow custom bows and food to be registered using the API (#3782) 2023-05-21 13:22:15 +01:00
Konicai c2285e018b Merge remote-tracking branch 'upstream/master' into feature/1.20 2023-05-15 14:05:23 -04:00
Konicai 21623fee20
Remove special cases in block/item populators that are no longer necessary 2023-05-13 00:05:22 -04:00
rtm516 870a838c0f
Add the ability for custom items to show with an enchantment glint (#3766) 2023-05-13 00:40:17 +01:00
Konicai d0bf0013ec
Use the mapped bedrock item identifier (instead of java) to fill the record registry 2023-05-11 20:08:43 -04:00
Camotoy 8849fd7018
Revert "Revert "Drop support for versions less than 1.19.80 (#3758)""
This reverts commit d93f3dd1f5.
2023-05-11 12:38:49 -04:00
Camotoy d93f3dd1f5
Revert "Drop support for versions less than 1.19.80 (#3758)"
This reverts commit 7b05ca3c41.
2023-05-11 12:38:11 -04:00
Konicai 7b05ca3c41
Drop support for versions less than 1.19.80 (#3758) 2023-05-11 12:36:19 -04:00
AJ Ferguson fbac0c10db
Fix creativeNetId overlap (#3756) 2023-05-10 09:41:36 +01:00
rtm516 6da8d5e7be
Add custom items to registry 2023-05-08 20:54:49 +01:00
Camotoy 6e9b272f50
Should fix custom items and durability 2023-05-03 20:17:05 -04:00
Camotoy f3f30625d4
Gracefully handle invalid level event IDs
Fixes #3714
2023-05-03 11:01:31 -04:00