Commit graph

1777 commits

Author SHA1 Message Date
modmuss50
c32692638c Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-11-12 18:40:21 +00:00
Fabric Bot
e60e56d4cb
Translation updates (#4194) 2024-11-12 18:16:29 +00:00
fishshi
01d9a51c61
Add AFTER_CLIENT_WORLD_CHANGE (#4173)
* add AFTER_CLIENT_WORLD_CHANGE

* fix

* move

* add description to README and change class to final with a private constructor

* revert the event name
2024-11-12 18:16:14 +00:00
Syst3ms
8e331c5709
Data Attachment Sync API (#4049)
Completes the data attachment API with client-server syncing capabilities.

## Motivation

The existing API works great for attaching data to game objects, be they serverside or clientside, but lacks any ability to synchronize between the two.

A mod that wants to add a "thirst" mechanic can easily do so on the server side by attaching an integer to every player. However, the mod may also want to use this information to render additional HUD elements on the client. Currently, informing the client of this data can only be done manually, which is cumbersome, error-prone, and is much better-suited as an API feature.

## API Changes

The API doesn't change a lot (at least compared to the implementation), with a few new methods and one new class.

One new method has been added to `AttachmentRegistry.Builder`, namely `syncWith`. It declares that an attachment type may be synchronized with some clients, and takes a `PacketCodec` to encode attachment data over the network, as well as an element of the new `AttachmentSyncPredicate` interface.

This interface extends `BiPredicate<AttachmentTarget, ServerPlayerEntity>` to allow for user-defined predicates, and provides some common presets:
* `all()`: attachment data will be synchronized with all clients (that track the target).
* `targetOnly()`: attachment data will only be synchronized with the target it is attached to, when it is a player. If the target is not a player, it won't be synchronized with any client.
* `allButTarget()`: reverse of the above. For non-player targets, attachment data will be synchronized with all clients.

**NOTE**: for a user-defined condition, whether attachment data is synchronized with a client can change at runtime (e.g. "sync only with operators" when a player changes operator status). A specialized method to "refresh" data was considered, but in the end discarded due to complexity. It falls to individual mods to handle these edge cases.

AttachmentType also gets one new `isSynced` method to know whether a given attachment type can be synced.

## Usage

Here is how one could register an attachment for a "thirst" meter like mentioned above.
```java
public static final AttachmentType<Integer> THIRST = AttachmentRegistry.<Integer>builder() 
    .initializer(() -> 20) // start with a default value like hunger
    .persistent(Codec.INT) // persist across restarts
    .syncWith(PacketCodecs.VAR_INT.cast(), AttachmentSyncPredicate.targetOnly()) // only the player's own client needs the value for rendering
    .buildAndRegister(Identifier.of("modid", "thirst"));
```
2024-11-12 18:16:04 +00:00
modmuss50
80c4fadaf8 Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-10-26 17:08:54 +01:00
apple502j
5b5275af51 Fix overriding vanilla translations (#4187)
(cherry picked from commit e82f21f7e9)
2024-10-26 15:55:27 +01:00
Jason Penilla
0f6c53cd2e Add ServerChunkEvents.Generate (#4183)
* Add a new chunk generate event, fired alongside the chunk load event when a chunk is first upgraded to full status

* fix style

* Add logging test for generate event

After creating an SP world and waiting for all nearby chunks to generate (logging to stop), closing the SP world and opening it again should not log any fresh generation. Moving to an unexplored area will start logging again.

(cherry picked from commit 4402f4ee73)
2024-10-26 15:55:25 +01:00
SemmieDev
be1ed2d72d Remove LevelProperties check (#4171)
(cherry picked from commit 6c3b5d4971)
2024-10-26 15:55:20 +01:00
Fabric Bot
7fd48375f5
New Crowdin updates (#4167)
* New translations en_us.json (German)

* New translations en_us.json (Italian)

* New translations en_us.json (Russian)

* New translations en_us.json (Polish)

* New translations en_us.json (Russian)

* New translations en_us.json (Korean)
2024-10-26 15:53:18 +01:00
forgetmenot13579
e49211d8c6
AttachmentType Registration Enhancements (#4109)
* - Add new method AttachmentRegistry#create that allows configuration of the registered attachment type with a builder.
- Migrate existing creation methods to use the new one under the hood for consistency.
- Moves all null checking from AttachmentRegistry to AttachmentRegistryImpl.BuilderImpl (most of them happened there as well already and were thus redundant).

* - Adds the ability to initialize an AttachmentType with only a path, substituting the mod ID of the registrant via an entrypoint.

* - Add registration safety checks

* - Add missing copyright header

* - Remove lazy entrypoint initialization of attachment types.

* - Import fixes

* - Update javadoc.

* - Use expression lambdas.

* - Fix style checks

* - More style fixes

* - Fix line endings

* - Move WheelInfo and initialization to test package
- Deprecate AttachmentRegistry#builder
- Update existing tests to use #create rather than #builder
2024-10-26 15:53:08 +01:00
Reece Mackie
6823f7cd48
fix: Add operator tab to common group list and filter for visible tabs in getPageCount. (#4172)
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-10-21 09:38:25 +01:00
modmuss50
b6ed6c19bb Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-10-15 15:21:08 +01:00
modmuss50
95bead5fff Fix tests 2024-10-15 14:41:59 +01:00
modmuss50
2986a625c7 Fix build after bad merge 2024-10-15 14:16:00 +01:00
BasiqueEvangelist
c0bdb897d1 Add support for Item-containing Items (#4083)
* first steps toward container item support

* add bundle support

* Update fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/ContainerComponentStorage.java

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>

* address reviews + TIL ContainerItemContext#find exists

* address reviews of bundle code

---------

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>

(cherry picked from commit 4054068033)
2024-10-15 13:27:26 +01:00
IThundxr
83a9d3130d
Add Stripped Logs and Stripped Woods Tags (#4146)
* Add Stripped Logs and Stripped Woods Tags

* run spotless

* Address review
2024-10-15 13:23:42 +01:00
TelepathicGrunt
dde8f6bb9c
Add more c fluid tags (#4134)
* Add more `c` fluid tags

* fixed a javadoc

* Cleaned up javadoc

* checkstyle

* removed space

* Adjust experience rate to more reasonable amount

* explain perfect extractions

* fixed javadoc
2024-10-15 13:16:22 +01:00
Fabric Bot
487ccc21c8
New Crowdin updates (#4124)
* New translations en_us.json (Polish)

* New translations en_us.json (Italian)

* New translations en_us.json (German)

* New translations en_us.json (Japanese)
2024-10-15 13:16:13 +01:00
Joseph T. McQuigg
29d3a7035e
Add Pie Item Tag c:foods/pie (#4114)
Co-authored-by: modmuss <modmuss50@gmail.com>
2024-10-15 13:16:05 +01:00
modmuss50
3b9245a976 Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-09-23 19:28:58 +01:00
modmuss50
d831205f6d Fix cherry pick issues 2024-09-23 19:19:42 +01:00
BasiqueEvangelist
5253a6d2b8 Add ItemVariant#withComponentChanges and FluidVariant#withComponentChanges (#4082)
* add ItemVariant#withChanges and FluidVariant#withChanges

* withChanges -> withComponentChanges

* add TransferVariant#withComponentChanges

* make TransferVariant#withComponentChanges throw

(cherry picked from commit 1d5c24337f)
2024-09-23 18:48:31 +01:00
Joseph Burton
c7469b213f
Add access to ClientConfigurationNetworkHandler in context (#4097) 2024-09-23 18:47:02 +01:00
TelepathicGrunt
9d22c5fde0
Create c:obsidians block and item tag (#4088)
* Create `c:obsidians`

* Add obsidians subtags
2024-09-23 18:46:54 +01:00
Fabric Bot
9d3173d557
New Crowdin updates (#4086)
* New translations en_us.json (German)

* New translations en_us.json (Turkish)

* New translations en_us.json (Chinese Simplified)

* New translations en_us.json (Polish)

* New translations en_us.json (Czech)

* New translations en_us.json (Japanese)
2024-09-23 18:46:34 +01:00
TheDeathlyCow
d5debaed0e
Modify Enchantment and Fabric Component Map Builder Extensions (#4085)
* modify effects event

* give impaling fire aspect

* add fabric component map builder

* change interface name to match event

* gametests for weird impaling enchantment

* fix checkstyle issues

* fabric map builder javadoc

* modify effects javadoc

* fix checkstyle issues

* prefer extension methods over add

* add enchantment source

* fix missing asterisk on fabricitemstack javadoc

* switch to enchantment builder

* fix effects list

* fix checkstyle

* add note on exclusive set to javadoc

* add fabric component builder extensions to default component testmod

* remove threadlocal usage from mixin

* remove modid prefix from accessors

* remove unused import

* fix recursive invoker

* add test to automatically check modified item name
2024-09-23 18:46:27 +01:00
modmuss50
e521378444 Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-09-10 13:27:30 +01:00
modmuss
427f7cbfec Use unix line endings on all files (#4079)
(cherry picked from commit f83d9a4a4d)
2024-09-10 13:17:44 +01:00
modmuss
d38f898f77 Add TransferVariant.getComponentMap() (#4074)
* Add TransferVariant.getComponentMap()

* used the cached stack

* Even better

(cherry picked from commit 0771530439)
2024-09-10 13:17:38 +01:00
TelepathicGrunt
405385578e
Add missing minecraft:enchantable/vanishing to c:enchantables (#4058) 2024-09-10 13:15:33 +01:00
Fabric Bot
aa34100ae2
New Crowdin updates (#4059)
* New translations en_us.json (Portuguese, Brazilian)

* New translations en_us.json (Malay)

* New translations en_us.json (Korean)

* New translations en_us.json (Malay (Jawi))

* New translations en_us.json (Malay (Jawi))

* New translations en_us.json (Malay (Jawi))

* New translations en_us.json (Polish)

* New translations en_us.json (Portuguese, Brazilian)
2024-09-10 13:15:21 +01:00
TelepathicGrunt
3d2379b573
Add c:animal_foods tag (#4080)
* Add `c:animal_foods` tag

* checkstyle

* Spotless

* Add to lang generator

* Actually use the generated lang file

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2024-09-10 13:15:13 +01:00
modmuss50
f054fb578a Bump version
Some checks are pending
Build / build (21-ubuntu) (push) Waiting to run
Build / client_test (push) Waiting to run
Build / server_test (push) Waiting to run
Build / check_resources (push) Waiting to run
2024-08-26 12:11:37 +01:00
TheDeathlyCow
2122d828f0
After Damage Event (#4051)
* after damage event

* add after damage event to testmod

* remove amount > 0 check to capture shield blocking

* add javadoc

* dont fire event if killed

* clarify javadoc a bit more

* fix checkstyle issue

* fix other checkstyle issues lol

* rename damageDealt to baseDamageTaken
2024-08-26 12:02:20 +01:00
AshyBoxy
3fc0e552c4
Dont invoke ItemGroupEvents.MODIFY_ENTRIES_ALL for the OP tab, when the OP tab is disabled (#4045) 2024-08-26 12:02:11 +01:00
Fabric Bot
9b16164179
Translation updates (#4027)
* New translations en_us.json (Korean)

* New translations en_us.json (Japanese)

* New translations en_us.json (German)

* New translations en_us.json (Chinese Simplified)

* New translations en_us.json (Italian)
2024-08-26 12:01:36 +01:00
modmuss50
343cdcb01b 1.21.1
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-08-11 17:23:06 +01:00
modmuss
e26765fae8
Install git in build workflow (#4025) 2024-08-11 15:13:09 +01:00
modmuss50
86f8729ec4 Bump versions 2024-08-11 15:00:10 +01:00
Fabric Bot
605f22add7
New Crowdin updates (#4003)
* New translations en_us.json (Chinese Simplified)

* New translations en_us.json (German)

* New translations en_us.json (Italian)
2024-08-11 14:52:51 +01:00
Juuz
fc91317048
Add crop and nugget tags (#4008)
* Add #c:nuggets/iron and #c:nuggets/gold

Closes #4005.

* Add crop item tags

Everything but c:crops/cocoa_bean is already in NeoForge.

* Add more crop tags and documentation for #c:crops
2024-08-11 14:52:25 +01:00
modmuss
8b68f1c766
Fix handled screen not calling super.mouseReleased or super.mouseDragged (#4010) 2024-08-11 14:52:13 +01:00
modmuss
1db1cc1f63
Crafter support for the transfer api. (#4013)
* Crafter support for the transfer api.
Closes #4004

* Review feedback
2024-08-11 14:52:04 +01:00
modmuss
dcbd126aea
Update grgit (#4019) 2024-08-11 14:51:54 +01:00
TelepathicGrunt
a1f763fa52
Add chorus fruit to c:foods/fruit tag (#4021)
* Add an API to add additional supported blocks to block entity types. (#4009)

(cherry picked from commit 40875a9333)

* Bump version

* Add chorus fruit to 1c:foods/fruit` tag

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
2024-08-11 14:51:42 +01:00
modmuss50
e8bb7c8e9a Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-08-07 18:52:06 +01:00
modmuss
40875a9333
Add an API to add additional supported blocks to block entity types. (#4009) 2024-08-07 18:39:15 +01:00
modmuss50
1daea21533 1.21.1-rc1 2024-08-07 16:54:26 +01:00
modmuss50
7363c44ea9 Bump version
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
2024-08-05 10:52:50 +01:00
modmuss
60c3209bf5
Revert registry sync changes. Allowing duplicate entries and vanilla clients on servers with modded registries. (#3999)
* Revert "Prevent vanilla clients from joining servers that require modded registry entries. (#3992)"

This reverts commit 8759e7555a.

* Revert "Throw the exception when a duplicate registry entry is found. (#3991)"

* Keep javadoc fix
2024-08-05 10:51:31 +01:00