Commit graph

1861 commits

Author SHA1 Message Date
ArduFish123
58cfdace86
Fixed typo in README.md () 2024-12-02 19:53:25 +00:00
modmuss
5bea021697
Fix some datagen taws () 2024-12-02 19:53:02 +00:00
modmuss
a4eebcf09c
Remove unused BlockPickInteractionAware interface () 2024-12-02 19:52:51 +00:00
modmuss50
3f9bae29e2 1.21.4-rc3 2024-11-30 19:04:03 +00:00
modmuss50
085903dbca Bump version 2024-11-30 18:27:16 +00:00
PepperCode1
6a293bdb89
Update Model Loading API to 1.21.4 ()
* Update Model Loading API to 1.21.4

- Split model modifier events and callbacks - one set for static models and one set for block models
  - This is necessary because static models use UnbakedModel and are baked with settings while block models use GroupableModel and are not baked with settings
  - This cleans up the Identifier/ModelIdentifier getters
  - OnLoad for block models was not added because the unbaked block model map is not a cache and block models cannot inherit from other models
- Make DelegatingUnbakedModel a record to allow accessing the delegate ID
- Remove BuiltinItemRenderer, BuiltinItemRendererRegistry, and BuiltinItemRendererRegistryImpl as they were replaced by a TAW to SpecialModelTypes.ID_MAPPER

* Add fabric_ prefix to methods in BakedModelsHooks and fix checkstyle

* Remove ModelResolver and BlockStateResolver

- The functionality of ModelResolver could be perfectly replicated with ModelModifier.OnLoad with OVERRIDE_PHASE
- The functionality of BlockStateResolver could be perfectly replicated with ModelModifier.BeforeBakeBlock with OVERRIDE_PHASE
- Fix log warning caused by half_red_sand.json not defining particle sprite

* Re-add BlockStateResolver and ModelModifier.OnLoadBlock

- BeforeBakeBlock runs too late to allow modifying how models are grouped, so OnLoadBlock is necessary to allow that
- OnLoadBlock only runs for models which were actually loaded from blockstate files, so BlockStateResolver is necessary to allow adding models for blocks without a corresponding blockstate file
- Add UnwrappableBakedModel
  - Moved and renamed from FRAPI's WrapperBakedModel (original will be deleted in separate PR)
  - Implement it and interface inject it on vanilla's WrapperBakedModel
  - Add new static UnwrappableBakedModel#unwrap method which accepts a Predicate saying when to stop unwrapping
- Add WrapperUnbakedModel which simply delegates all method calls to a different UnbakedModel

* Remove ModelModifier.*Bake*

- Remove BeforeBake, AfterBake, BeforeBakeBlock, AfterBakeBlock
- Remove DelegatingUnbakedModel
- Add WrapperGroupableModel
- Add documentation and extra constructor to WrapperUnbakedModel

* Clarify OnLoad doc about meaning of null model
2024-11-30 18:18:10 +00:00
modmuss
bdca9acb21
Add more data generation TAWs ()
* Add TAW for BlockStateModelGenerator.CrossType

* And more
2024-11-30 18:17:26 +00:00
modmuss50
70277babdd Fix CurseForge game version capitalisation yet again... 2024-11-27 18:37:25 +00:00
modmuss50
c6abe49647 Bump versions 2024-11-27 18:10:50 +00:00
modmuss50
1885ad74d1 1.21.4-pre3 2024-11-27 18:08:27 +00:00
modmuss
cc0fa2fec8
Add optional registries & refactor registry sync ()
* Refactor registry sync

* Remove old file

* Checkstyle

* Fixes

* Improve error message

* Fix

* Fix test
2024-11-27 18:01:38 +00:00
modmuss
b90fb141f3
Update loom () 2024-11-27 18:01:28 +00:00
modmuss50
b9e68eb56c Bump version 2024-11-25 18:27:43 +00:00
JustRed23
6dc662b6c6 Fix AFTER_SETUP event not being able to render ()
* Add BEFORE_TERRAIN world render event

* Add 1.21.2 rendering issue warning

* Add comment to injection point

* close b tag

* Undo all new event changes

* Move AFTER_SETUP event to new mixin

* Remove event interface

* Refine mixin

(cherry picked from commit 69228316a9)
2024-11-25 18:23:43 +00:00
Daniel Orr
56e78b9be0 Add transitive access wideners for tracked data related creator entity methods ()
* feat: transitive access wideners for display entity fields

* fix: change display transitive access widener collector to check for dataTracker accesses

* fix: incorrect method names & comments

* refactor: move getMethodParameterCount to use existing lib

* feat: InteractionEntity methods & missing method from DisplayEntity

(cherry picked from commit 54a41b1cc9)
2024-11-25 18:13:37 +00:00
modmuss
aa5b2ca19e
Add RegistryEntryAddedCallback.allEntries ()
* Add RegistryEntryAddedCallback.allEntries

* Pass a RegistryEntry.Reference

* Remove some temp test code

* Add note about recursion.
2024-11-25 18:12:59 +00:00
modmuss
6383078589
Fix crash with custom signs. () 2024-11-25 18:12:28 +00:00
modmuss50
5f014276c3 1.21.4-pre2 2024-11-25 18:11:53 +00:00
modmuss50
5d559cbc72 1.21.4-pre1 2024-11-20 15:12:48 +00:00
modmuss50
7db2e61470 Bump version 2024-11-18 18:34:18 +00:00
modmuss50
334f9fee6f Rename includeData to requestIncludeData and improve docs. 2024-11-18 18:28:25 +00:00
fishshi
e496eb156b Change outdated setPredicate to addPredicate. ()
(cherry picked from commit c9d82ab2d8)
2024-11-18 18:08:00 +00:00
modmuss
9aea556b88
Provide a RegistryByteBuf for attachment syncing ()
* Provide a RegistryByteBuf for attachment syncing

* None breaking?

* Slight improvement

* Test syncing an item stack

* Jdoc fix

* Jdoc fix
2024-11-18 18:07:34 +00:00
modmuss
8ca5486fd5
Fix client test random crashes ()
* Fix client test random crashes

* Improve

* Even easier
2024-11-18 18:07:19 +00:00
modmuss50
8eedec2580 Fix ModelProvider.ItemAssets generating duplicate models. 2024-11-18 18:06:51 +00:00
Jochen Jacobs
105e1a95fc
Add transitive access wideners for ID_MAPPER of ItemModelTypes and related types ()
* Add transitive access wideners for ID_MAPPER of ItemModelTypes and related types

* generate resources
2024-11-18 18:05:39 +00:00
apple502j
f12498d0af
Fix includeData in pick events ()
* Fix includeData in pick events

* Fix javadoc
2024-11-18 18:05:28 +00:00
modmuss50
a884cf33d9 Ensure that the full datagen test is ran on build. 2024-11-14 11:01:15 +00:00
modmuss50
34467ab425 Add back missing generated atlas files 2024-11-13 18:38:46 +00:00
modmuss50
203e6b2369 24w46a 2024-11-13 18:31:05 +00:00
modmuss50
b488af79da Bump version 2024-11-12 18:40:34 +00:00
fishshi
84536d3243 remove outdated SUCCESS_NO_ITEM_USED () 2024-11-12 18:34:36 +00:00
Fabric Bot
15afce79f4 Translation updates () 2024-11-12 18:31:25 +00:00
fishshi
bf2a60ebf8 Add AFTER_CLIENT_WORLD_CHANGE ()
* 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:31:23 +00:00
Syst3ms
ca8aad0623 Data Attachment Sync API ()
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:31:14 +00:00
Prospector
b45c27852a
Fix raw materials item tag having duplicate entries (Fixes ) () 2024-11-12 18:16:50 +00:00
Prospector
8ff5c951d0
Add stripped pale oak logs & wood to their respective conventional tags (Fixes ) () 2024-11-12 18:16:40 +00:00
modmuss50
a81ce912a4 Bump version 2024-11-08 13:56:10 +00:00
modmuss
60fccc7682 Fix crash when none player entities are flying with an elytra. ()
Fixes 

(cherry picked from commit 825023f82e)
2024-11-08 13:53:31 +00:00
modmuss50
6d397b1b49 Fix CurseForge release. 2024-11-06 21:30:41 +00:00
modmuss
77a65688c8
Update to 24w45a ()
* Update to 24w45a

* Fix model provider and build

* Remove old mixin file

* Bump versions
2024-11-06 21:10:00 +00:00
haykam821
7feeb733ad
Update mod to Minecraft snapshot 24w44a ()
* Update mod to Minecraft snapshot 24w44a

* Bump version

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2024-10-30 18:44:56 +00:00
modmuss
fd37071f8b
Update Loom and Loader () 2024-10-27 09:44:05 +00:00
modmuss50
e14d62e1c0 Bump version 2024-10-26 17:09:02 +01:00
apple502j
e82f21f7e9
Fix overriding vanilla translations () 2024-10-26 15:54:53 +01:00
modmuss
89cb0a4eef
Revert "Prevent vanilla clients from joining servers that require modded registry entries. ()" ()
This reverts commit 56ec7ac6d8.
2024-10-26 15:54:42 +01:00
Jason Penilla
4402f4ee73
Add ServerChunkEvents.Generate ()
* 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.
2024-10-26 15:54:31 +01:00
Alexander01998
d21566ae3c
Optimize screenshot delays in automated client test ()
* Optimize screenshot delays

I've done multiple test runs on GitHub Actions and this seems to be as low as the timings can go while still reliably generating all of the screenshots correctly.

* Increase wait interval in waitFor to 50ms
2024-10-26 15:54:20 +01:00
SemmieDev
6c3b5d4971
Remove LevelProperties check () 2024-10-26 15:54:12 +01:00
Fabric Bot
1ff58ec271 New Crowdin updates ()
* 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)

(cherry picked from commit 7fd48375f5)
2024-10-26 15:53:49 +01:00