Commit graph

1377 commits

Author SHA1 Message Date
Juuz
86d48884d3 Add event for preventing particle tinting for colored blocks (#3146)
- Adds an event, `ParticleRenderEvents.ALLOW_BLOCK_DUST_TINT`, that checks
  if a block dust particle of a specific block can be tinted.
- Bumps Fabric Loader requirement of fabric-particles-v1 to latest to
  disable Loader's mixin compatibility mode that ignores slices for
  certain At annotations.

Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-07-03 13:19:38 +01:00
Technici4n
c956c0e61d Fix default fluid names for non-placeable fluids, clarify Storage iterator lifecycle with modification (#3141)
* Fix default fluid names for non-placeable fluids, clarify Storage iterator lifecycle with modification

* Fix blank variant translation accidentally changing
2023-07-03 13:13:56 +01:00
Deximus-Maximus
0eee1254b5 Add support for partially synced client tags (#3118)
* Draft v1.1.0

* Resolve some comments

* Add javadoc

* Remove old behavior

* Minor cleanup

* Add test for partially synced tags

* Address nitpick

* Fix checkstyle

* Hard fail when datapack fails to regsiter

Co-authored-by: modmuss <modmuss50@gmail.com>

* Fix missing import

* Refactor
Don't recurse through tag hierarchy

* Add note for test

* Adjustments to logic to handle server-missing nested tags

* Restore recursive search, add tracking of checked tags

* Cleanup

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
2023-07-03 13:13:13 +01:00
Shnupbups
d63b52ea53 Add builders for BlockSetType and WoodType to replace registries (#3115)
* Add builders for BlockSetType and WoodType to replace registries

Adds `BlockSetTypeBuilder` and `WoodTypeBuilder` to replace `BlockSetTypeRegistry` and `WoodTypeRegistry` respectively.

* whoops

* double whoops

* Register and Build now separate methods

Separated the register and build methods, with the former calling the latter. Their relationship is explained in the javadoc.

* Update BlockSetTypeBuilder.java

Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-07-03 13:13:08 +01:00
Juuz
d0403fca23 Update Finnish translation (#3166) 2023-07-03 13:12:04 +01:00
I_am_Vietnam
da41e1a998 Add vi_vn.json (#3167)
* Create vi_vn.json

* Create vi_vn.json
2023-07-03 13:12:01 +01:00
CoolChicken321
e617951038 Update Spanish translations 2023-07-03 13:11:59 +01:00
modmuss50
4a06bd12f2 Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-06-21 10:17:58 +01:00
PepperCode1
c6bbc80da8
Interface inject FabricBakedModel (#3099)
### API Changes
- Interface inject `FabricBakedModel`
This change was done to eliminate the constant need to cast `BakedModel` to `FabricBakedModel`, especially when rendering sub-models. The implementations for the methods of `FabricBakedModel` were moved from `BakedModelMixin` to `FabricBakedModel` as default implementations. Some javadoc was updated to reflect this change.
- Deprecate the mesh consumer (`Consumer<Mesh>` retrieved from `RenderContext`)
This change was done to ensure consistency across all current and future contexts in which a mesh may need to be output to a quad emitter. The preferred direct replacement is the new method `Mesh#outputTo(QuadEmitter)`. Some javadoc was updated to reflect this change.
- Deprecate the baked model consumer (`BakedModelConsumer` retrieved from `RenderContext`)
This change was done to ensure consistent rendering of sub-models and to eliminate assumptions about what features a model uses. The preferred direct replacement is to use the appropriate `emit` method in `FabricBakedModel`. Some javadoc was updated to reflect this change.
Even though the consumer is now deprecated, the default `FabricBakedModel` method implementations still use it and renderers must still implement the getter. This is because Indigo and Indium sometimes apply smooth lighting differently based on if the quad came from a vanilla model or not. The eventual solution to allow all baked model consumer usage to be removed is to allow renderers to override the default `BakedModelMixin` and handle default vanilla models directly.
- Fix `QuadView#toVanilla`'s javadoc reporting the wrong minimum array size

### Implementation Changes
- Restructure `RenderContext` implementations
This change was done to reduce code duplication, improve standardization, and improve readability. Most code of `AbstractQuadRenderer` was moved into a new class called `AbstractBlockRenderContext` (which `BlockRenderContext` and `TerrainRenderContext` now extend), with the main buffering method being moved to `AbstractRenderContext`.
- Remove red blue color swap
It is unclear why this code was necessary in the first place. Indigo stores vertex color in ARGB format, then converts it to ABGR format only if the native byte order is little endian, and then reads the vertex color in ABGR format when buffering vertex data. This would mean that on big endian systems, all red and blue color components would be swapped.
Now, color is read in ARGB format when buffering and no color format conversion or swapping is done.
- Encode face normal
This change was done to improve the performance of meshes. Meshes already encoded all other geometry data, but the face normal would still have to be recomputed every time a mesh quad was rendered. Now, it is stored in the quad data header, so it is simply decoded, which is significantly faster.
- Fix some bugs
  - Outputting a mesh via the mesh consumer would result in the emitter retaining the data of the last quad in the mesh.
  - In non-terrain block rendering, the baked model consumer would incorrectly use the random seed provided by the block state instead of the passed random seed argument.
  - When converting to or from vanilla quad data, the color would not be converted. Indigo uses ARGB format to store color, while vanilla quads use ABGR or RGBA. See the comment near the bottom of `ColorHelper` for more information.
  - Fix TerrainRenderContext using incorrect overlay value of `0` instead of `OverlayTexture.DEFAULT_UV`.
- Improve performance of some code
  - `QuadViewImpl#computeGeometry()` was being called before transforms and the cull test were applied. These operations can change the geometry and invalidate computed geometry data or cancel the quad outright. Calling the method explicitly in those contexts was also not necessary in the first place.
  - A single `Vector4f` instance is now reused to transform the vertex position instead of allocating a new `Vector4f` for each vertex.
  - The random seed lazy computation now uses a separate boolean instead of checking if the seed is `-1`.
2023-06-21 09:58:54 +01:00
modmuss50
88323df583 Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-30 13:41:01 +01:00
modmuss
10ce000fa5 Setup unit tests & format gradle files. (#3073) 2023-05-30 13:10:24 +01:00
Maity
cd417cfcaf fix: floral tag missing meadow biome (#3078)
* floral tag missing meadow biome

* run datagen
2023-05-30 13:10:19 +01:00
modmuss
cd545891bb Set player.currentScreenHandler before invoking ExtendedScreenHandlerFactory (#3077)
* Set player.currentScreenHandler before invoking ExtendedScreenHandlerFactory

* Add comment

* Cleanup code
2023-05-30 13:10:17 +01:00
Technici4n
cff5633a65 Fix FabricBlockLootTableProvider breaking depending on the mapping set (#3070)
* Initial fix for FabricBlockLootTableProvider depending on mappings

* Remove internal implementation methods from  interface

Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-30 13:10:06 +01:00
Roman / Linnea Gräf
aba27ca29f Add metadata information to POMs (#3074)
* Add metadata information to POMs

* Add name, description, url and issue management

Also update the license name and an url to the fabric website
Pulls name and description from the fabric.mod.json

* Fix imports and make git optional

* Remove commit from maven metadata
2023-05-30 13:07:48 +01:00
Technici4n
86f2414baa
Move injection point of TooltipComponentCallback (#3085) 2023-05-30 12:59:06 +01:00
qouteall
5f4a2056f3
Add an event that fires when client player left-clicks (#3043)
The ClientPreAttackCallback will fire every tick when the attack key is pressed, before vanilla attack handling. If the callback returns true, then the vanilla handling (breaking block, attacking entity, swining hand) will be cancelled. For multiple callbacks, if the former callback returns true, the later callback won't execute.

This event does not consider attack cooldown.
2023-05-30 12:51:38 +01:00
modmuss50
9b1d9bbd0e Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-24 21:22:08 +01:00
PepperCode1
52cca24e15
Material inspection (#3066)
* Material inspection

- Add MaterialView to get material properties from RenderMaterial and MaterialFinder
- Add MaterialFinder#copyFrom to copy properties from another MaterialView
- Finish todo in QuadView#toBakedQuad
- Move material impl classes to material package

* Add glint material property

- Allow force enabling or force disabling glint on items
- Force enable glint on horizontal sides of pillar item model in test mod

* Fix imports

* Add documentation

* Do not create invalid materials

- Ensure material bits are valid before creating material
- Assert that default MaterialFinder bits are valid
- Remove ordinal checks in MaterialViewImpl since bits are now guaranteed to be valid
- Set default glint mode to default instead of false
- Remove getter overrides in RenderMaterialImpl

* Add MutableQuadView#copyFrom

- Deprecate QuadView#copyTo

* Add missing nullability annotations
2023-05-24 17:30:12 +02:00
Technici4n
2198ff13ff Bump version 2023-05-15 21:35:10 +02:00
Maity
fe8721be1f Add #c:flower_forests to #c:floral convention tag (#3065) 2023-05-15 21:05:59 +02:00
Maity
b4a333d661 Fix last few transitive access wideners missing the transitive- prefix (#3064)
Also add validation to make sure that the generated `.accesswidener` has only transitive access modifiers.
2023-05-15 21:05:59 +02:00
modmuss50
7e532d225e Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-14 15:15:33 +01:00
Technici4n
c98e6b2742
Convention Tags Improvements (#3051)
* First pass: refactor a bit, add missing item tags that have block tags, add resource category tags and wooden_barrels

* Fix #2831: Move entity buckets to c:entity_water_buckets

* Add villager_job_sites and sandstone tags

* Add alternative cauldrons to villager job sites.

Signed-off-by: modmuss50 <modmuss50@gmail.com>

---------

Signed-off-by: modmuss50 <modmuss50@gmail.com>
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-05-14 15:00:30 +01:00
Technici4n
03ba59ce20
Add TAWs for DamageSources (#3048)
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-05-14 14:59:58 +01:00
Technici4n
ebc93ff392
Remove texture indices and make material AO a TriState (#3044)
* Reorganize method order

* Remove texture indices

- Add allow passing shade boolean to QuadView#toBakedQuad
- Add MutableQuadView#fromVanilla(int[], int)
- Add NonExtendable annotation to SpriteFinder and RendererAccess
- Add note to RenderContext#bakedModelConsumer

* Make Material AO a TriState

Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>

* Rename spriteUnitSquare -> uvUnitSquare

* Remove toBakedQuad with shade boolean parameter

* Add custom apiNote, implSpec, and implNote javadoc tags

* Reject null BlendMode and AO; clarify fromVanilla(int[], int) javadoc

* cullFace nullability, fromBakedQuad shade clarification, toBakedQuad color index

* Add QuadView#copyUv and minor improvements

* Nullability tweaks

---------

Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
2023-05-14 14:57:28 +01:00
Technici4n
5ade3c3853
Fix getName for builtin packs not returning an internal name (#3047) 2023-05-14 14:57:09 +01:00
Juuz
80d07a0ab1
Improve transfer API debug messages (#3049)
* Add toStrings to Storage, ContainerItemContext and Transaction impls

* StorageUtil: Use crash reports for adding context to errors

* Drop Impl suffix from variant impl toStrings

Since they are the only implementations, it offers no meaningful info for
callers.

* Centralise formatting code, include BE inventory position

* Include amount and resource in all ContainerItemContext.toString impls

* Use crash callables in StorageUtil

* Add crash report to FluidStorageUtil

* Add owning thread to TransactionImpl.toString

* Use thread name in TransactionImpl.toString

The other info clutters the message.

* Fix code style
2023-05-14 14:56:35 +01:00
Technici4n
1e9487d203
Terminally deprecate EventFactory isProfilingEnabled and invalidate (#3050)
* Terminally deprecate `EventFactory` `isProfilingEnabled` and `invalidate`

* Remove `forRemoval` in `isProfiling` deprecation

* Also deprecate
2023-05-14 14:56:20 +01:00
Maity
ed1baa7042
Add some new TAWs for tree worldgen (#3060)
* TAWs for worldgen

* Impl suggestions

* Forgot run generateAccessWidener ;)
2023-05-14 14:56:08 +01:00
Xander
3bd4ab0f82
Fix screen api passing wrong MatrixStack to render events (#3061) 2023-05-14 14:55:35 +01:00
modmuss50
a37e8e70b7 Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-01 14:11:54 +01:00
modmuss50
504944c854
Split test mods into client and common. (#3033)
* Split test mods.

Signed-off-by: modmuss50 <modmuss50@gmail.com>

* Fixes

Signed-off-by: modmuss50 <modmuss50@gmail.com>

* Fixe datagen client

Signed-off-by: modmuss50 <modmuss50@gmail.com>

---------

Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-05-01 13:55:19 +01:00
modmuss50
9496b969b5
Fix a regresstion preveting clients with an un-modded regsitry joining servers with modded registries. (#3036) 2023-05-01 13:54:55 +01:00
Technici4n
76ba65ebd7
Add a Fake Player API (#3005) 2023-05-01 13:54:22 +01:00
modmuss50
1e1ae72503 Bump versions
All versions bumped due to loom upgrade

Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-04-23 13:39:49 +01:00
modmuss50
670e8ac6c5
Improve missing local registry entries error message. (#3004) 2023-04-23 13:21:39 +01:00
Technici4n
da9bb83539
Fix #3017: ComposterWrapper not always increasing on first insert (#3021) 2023-04-23 13:03:12 +01:00
Technici4n
6cebf059ec
Make custom ingredient types and load conditions appear early in generated JSONs (#3020) 2023-04-23 13:02:58 +01:00
ErrorCraft
f4f4ac6445
Add codec data provider (#2979) 2023-04-23 13:02:49 +01:00
modmuss50
77589c6df2
Update to Loom 1.2 and Gradle 8.1 (#3016) 2023-04-23 13:02:02 +01:00
modmuss50
01af69c870 Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-04-11 10:05:36 +01:00
Julian Burner
1e1fb126cb
Fix FabricWrappedVanillaResourcePack::getName (#2998)
* Fix `FabricWrappedVanillaResourcePack::getName`

* Remove unused import
2023-04-11 09:49:50 +01:00
Poodn
e719b8579f
Add missing error message argument in ClientCommandInternals(#2988)
Fixed a translation bug where "command.context.parse_error" was translated with two arguments, while it takes three as input.
2023-04-11 09:49:33 +01:00
notlin4
fde8e2ab4c
Update Traditional Chinese (#2980) 2023-04-11 09:48:53 +01:00
Technici4n
d51205db7d
Transfer API: Add slotted storage and non-empty iterator (#2908)
* Transfer API: Add non-empty iterator

* Add SlottedStorage

* Add StorageUtil.extractAny

* Undeprecate ContainerItemContext.withInitial

* Add licenses

* Revert "Undeprecate ContainerItemContext.withInitial"

This reverts commit dcf123eb332ff642cdbd5fda0d8d2237794d93fc.

* Tweaks

* Make SlottedStorage#getSlots return a view, remove useless field, add UnmodifiableView annotations

* Remove useless @inheritDoc

* Fix infinite loop in the tests
2023-04-11 09:48:38 +01:00
modmuss50
36f990282f Bump version
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-04-04 13:07:44 +01:00
apple502j
a6f3ccfaf8 Networking: introduce packet-object based API
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-04-04 12:55:12 +01:00
modmuss50
88da797301 Bump version 2023-03-15 12:29:56 +00:00
Julian Burner
938a1d5673
Support Programmer Art and High Contrast injections (#2960) 2023-03-15 12:01:00 +00:00