Commit graph

67 commits

Author SHA1 Message Date
modmuss50
eff26386be
23w16a (#3018)
# Breaking changes
- `VillagerPlantableRegistry` replaced with `ItemTags.VILLAGER_PLANTABLE_SEEDS`
- `FabricItemGroup.builder()` no longer takes an `Identifier`
- `FabricItemGroup.build()` no longer registers the ItemGroup, this now needs to go in the vanilla registry.
- `ItemGroupEvents.modifyEntriesEvent` now takes a `RegistryKey<ItemGroup>` in place of an `Identifier`
- `FabricLanguageProvider` now takes a `RegistryKey<ItemGroup>` in place of an `ItemGroup`
- `IdentifiableItemGroup` removed, replaced with vanilla registries.
- `FabricMaterialBuilder` removed, no replacement.
- `HudRenderCallback.onHudRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.beforeRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.afterRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `Screens.getItemRenderer()` removed. Replace with `MinecraftClient.getItemRenderer()`

`DrawableHelper` is likely to be renamed soon, see: https://github.com/FabricMC/yarn/pull/3548/
2023-04-20 20:03:32 +01:00
PepperCode1
81e8c5765a Indigo shade related fixes and other changes (#2898)
* Apply disabled shade from vanilla quads directly to material

- Remove QuadViewImpl.shade

* Fix enhanced AO calculation and respect non-terrain culling state

- Fix AoCalculator using AO face data computed with a potentially different shade state
- Move non-cached computation code to separate method in AoCalculator
- Turn AoCalculator's brightnessFunc and aoFunc into abstract methods
- Do not check null check world in non-terrain AO calculation since it cannot be null
- Pass through lightFace and shade state as method arguments in AoCalculator methods to prevent additional lookups
- Do not check for the axis aligned flag in AbstractQuadRenderer.shadeFlatQuad
- Respect cull parameter passed to non-terrain rendering by merging TerrainBlockRenderInfo into BlockRenderInfo
- Use reusable search pos when calling Block.shouldDrawSide to prevent additional BlockPos allocation
- Change BlockRenderContext.render and TerrainRenderContext.tessellateBlock to return void since return value is no longer used
- Remove QuadViewImpl.vertexStart since it is unused

* Add suggestions

- Mark Direction parameter to BlockRenderInfo.shouldDrawFace as Nullable
- Reuse MaterialFinder in FrameBakedModel

(cherry picked from commit 3a95925af4)
2023-02-23 10:15:13 +00:00
Technici4n
9f179aa14c
Indigo and Renderer API fixes related to fallback consumers (#2775)
* Fix #2639: Indigo fallback consumer does not respect BlendMode or emissivity

* Change renderer testmod to test material change

* Remove presumably unneeded `quad.geometryFlags()` call

* Also test emissivity

* Call emitBlockQuads in the testmod

* Allow passing the block state explicitly to the fallback consumer. Fixes #1871

* Expand testmod to also test item models

* Also fix fallback consumer ignoring material for items

* Slight changes

* Introduce new interface for the expanded fallback consumer

* Add javadoc to ModelHelper
2023-01-02 13:05:49 +00:00
Technici4n
afca2f3e33
Small Cleanups (#2767)
* ServerLoginNetworking javadoc fix

* Improve Rendering Data Attachment javadocs. Fixes #863

* Deprecate `NbtType`. Fixes #1401

* Remove redundancy
2022-12-23 13:10:03 +00:00
Technici4n
2063beff56
Add BakedModel unwrapping API (#2686)
* Add BakedModel unwrapping API

* Allow WrapperBakedModel to not have an inner model
2022-11-29 18:03:50 +00:00
Technici4n
91f53ef5b6
Cleanup Renderer API testmod (#2688) 2022-11-24 15:04:44 +00:00
modmuss50
02d6eeb0ca Log sprite id and not the atlas id for sprites with invalid bounds. 2022-11-23 17:13:51 +00:00
modmuss50
49abcf7e64 Update mappings 2022-11-16 16:12:51 +00:00
modmuss50
f84bf2d968
22w45a (#2647) 2022-11-10 16:07:38 +00:00
modmuss50
28cc6cc789 Merge remote-tracking branch 'origin/1.19.2' into 1.19.3
# Conflicts:
#	gradle.properties
2022-11-07 19:01:58 +00:00
Technici4n
12bfe4ea1a
Add a block appearance API (#2579)
* Add block appearance API

* Add class javadoc for FabricBlock and FabricBlockState

* Address reviews

* Remove OverrideOnly from getAppearance

* Fix javadoc issues
2022-11-07 18:29:51 +00:00
modmuss50
11ba9c3b22
22w43a (#2610)
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2022-10-26 20:48:38 +01:00
modmuss50
75e98211bd
22w42a 🐫 (#2599)
Co-authored-by: shartte <shartte@users.noreply.github.com>
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2022-10-22 20:38:33 +01:00
Technici4n
c0ae659db2
Skip adding out-of-bound sprites to SpriteFinderImpl (#2584) 2022-10-16 15:13:42 +01:00
modmuss50
c6af733cfb
Cleanup incorrect mixin shadow annotations/access 2022-09-25 14:46:29 +01:00
modmuss50
79adfe0a0e
Update Loom, Yarn, Checkstyle (#2538) 2022-09-25 14:46:02 +01:00
apple502j
93d8cb82e8
Fix many javadoc issues (#2526)
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2022-09-25 14:45:12 +01:00
modmuss50
aeb40ebeab
Rename and validate Mixin class names. (#2450)
And update loom.
2022-08-15 18:59:19 +01:00
apple502j
84f79e9d2d
ModelHelper: remove useless contract (#2422) 2022-08-06 19:04:31 +01:00
apple502j
83a865928d
Make static-only classes final and unconstructible (#2421)
The following classes have been made final and unconstructible:

- All convention tags classes
- `FluidVariantAttributes`
- `FluidVariantRendering`

The following classes have been made unconstructible:

- `BiomeModifications`
- `ClientEntityEvents`
- `ClientTickEvents`
- `LootTableEvents`
- `FabricDefaultAttributeRegistry`
- `MinecartComparatorLogicRegistry`
- `StorageUtil`

The following classes have been explicitly marked as final. Note that actually extending such class has always been impossible due to missing public constructor:

- `VillagerInteractionRegistries`
- `VillagerPlantableRegistry`
- `ModelHelper`
- `StoragePreconditions`

While the first two are technically breaking changes, there is no actual or observed usage for any of those.
2022-08-06 19:04:11 +01:00
modmuss50
9ff28f4026
Split client only code into its own sourceset. (#2179)
A common source of crashes on modded Minecraft servers comes from modders accidently calling client only code from the client, this PR is another large step towards elimitating that.

This PR has been months in the making and years in the planning, requiring major changes to Loom & Loader. In recent Minecraft versions Mojang has made it easier than ever to cleanly split the jar, going against the status-quo of merging the client and server into one jar.

From the start we have designed Fabric to have a very clear split between client and common (client & server) code. Fabric has always encoraged keeping client only code seprate from the server, this can be seen at a fundamental level with the entrypoints in Loader. Fabric API's have all been designed with this mind.

This PR provides a compile safety net around Fabric API using client only code on the server. Even though there are almost 400 changed files, minimal changes beyond moving the files were required to achieve this in Fabric API, thanks to the effort of all contributors in the past.

These changes should not affect modders or players in anyway, a single "universal" jar is still produced. Im happy to awnswer any questions.
2022-05-21 16:26:46 +01:00
modmuss50
23acfcd6a1 Update mappings. 2022-05-20 18:56:00 +01:00
modmuss50
8eae451042 22w15a 2022-04-13 19:03:57 +01:00
modmuss50
717abbc48a 22w14a 2022-04-06 21:49:45 +01:00
qolq
b0b66fc386
Fix Indigo UV rotation (#1945)
* Fix Indigo UV rotation

* Update MutableQuadView bakeFlags javadocs
2022-01-14 15:20:28 +00:00
Player
3ac43d9577 Revert Mixin compatibilityLevel bump, bump versions 2021-11-17 03:29:11 +01:00
modmuss50
e77d3ea62f 1.18-pre2 & Java 17 2021-11-16 18:41:10 +00:00
modmuss50
dc3d5c4769 21w38a 2021-09-23 18:30:50 +01:00
modmuss50
d11c59e0d5 21w37a: Finish porting mixins + fix test mod, runs in prod now. 2021-09-20 13:50:25 +01:00
modmuss50
5553aff888 21w37a: Compile pass 2021-09-17 18:42:42 +01:00
modmuss50
cbda9318cd
Update Gradle/Loom and mappings. (#1692)
* Update Gradle/Loom and mappings.

* Fix deprecations and enforce

* Review feedback

* More cleanup and deprecation fixes.
2021-08-31 14:00:20 +01:00
grondag
5f02c96920
Prevent SpriteFinder from returning Missing sprite for wrong atlas (#1541)
Co-authored-by: grondag <>
2021-07-05 18:47:06 +01:00
Cool_Mineman
8a5c621a87 Fix #1273 (Make MultipartBakedModel and WeightedBackedModel implement FabricBakedModel properly) (#1301)
* fix #1273

* Expand testmod to test multipart and weighted models with FRAPI submodels

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2021-06-10 14:09:00 +02:00
modmuss50
a02b4463f9 21w19a 2021-05-12 20:23:04 +01:00
i509VCB
6a8b6a39c8 Create a simple renderer api testmod (#1295)
* Create a simple renderer api testmod

* Update fabric-renderer-api-v1/src/testmod/java/net/fabricmc/fabric/test/renderer/simple/client/RendererClientTest.java

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

Co-authored-by: liach <7806504+liach@users.noreply.github.com>
(cherry picked from commit b0e4dde51b)
2021-04-14 19:29:28 +01:00
i509VCB
f8cf2bb436 Add custom value denoting module lifecycles. (#1253)
* Add custom value denoting module lifecycles.

* Make the module validation work.

My hand has been forced - we must use buildSrc since JsonSlurper is not available in main buildscript.

* Apply task to each project and dont cross projects

* A horrible hack

* Wait what

* It works now.

* Not needed

* Drop unneeded maven repo, cache map lookup

(cherry picked from commit daa38b3d82)
2021-01-19 18:54:23 +00:00
PepperCode1
f9381f3529 Fix javadoc and typo (#1270)
* Update RenderContext.java

* Update WorldRenderEvents.java

(cherry picked from commit d795f854a9)
2021-01-19 18:54:22 +00:00
yyny
35ad3817d3 Allow passing UV coordinates as Vec2f (#1238)
* Allow passing UV coordinates as Vec2f

Rotating UV coordinates using vector math becomes extremely annoying when every `sprite` call requires the individual `u` and `v` coordinates to be extracted again.

This change will allow passing UV coordinates in a container that will always be available.

* Revert b0fe27e0d7

* Allow Vec2f UVs in MutableQuadView

This seems like the better place to put this.

* Fix return type

oops

* Add override in QuadEmitter

* Fix JavaDoc styling

* Duplicate JavaDoc and function definition

There is probably a way in Java to override the method while keeping the JavaDoc, but I can't be bothered, and this way, the user gets a more relevant JavaDoc anyway.

* Remove Trailing Whitespace

I'm pretty sure QuadEmitter allowed trailing whitespace, though...

* Fix JavaDoc styling in QuadEmitter

Also removes trailing whitespace

(cherry picked from commit 00f5b23648)
2020-12-30 17:16:16 +00:00
modmuss50
e1f1abb1c0 20w49a 2020-12-02 19:02:44 +00:00
i509VCB
eacb8ba396
Update yarn mappings (#1127) 2020-10-22 18:54:44 +01:00
Technici4n
16a658fec4
Fix sprite and spriteBake (#1122) 2020-10-18 18:28:31 +01:00
Deximus-Maximus
5f10696617
Add @Nullable and friends (#1007)
* Boost to Loom 0.5
Add null related annotations

* Rearrange nullable to be overline

* Fix anno sorting for picky

* Add imports

* Address feedback

* Fix import
2020-09-27 12:10:02 +01:00
grondag
8bcfced859
Fix for #987 (#1046)
* Fix #987, simplify geometry tracking, clean up scoping

* Bump indigo version

* Expose improved fromVanilla method

* Strip deprecations in non-API components

* bump renderer api version

* Clear tag for converted quads

Otherwise possible for tags added by transforms to pollute subsequent quads

* Borrow from Canvas - don't set nominal face twice, prevent header state leakage
2020-09-03 19:50:26 +01:00
liach
eae12eb815
Add fabric model predicate provider registry (#601)
* Add fabric model predicate provider registry

Signed-off-by: liach <liach@users.noreply.github.com>

* Fix jd with new mappings

Signed-off-by: liach <liach@users.noreply.github.com>

* Bump module version

Signed-off-by: liach <liach@users.noreply.github.com>

* Remove redundant line

* Move inner class accessor to outer class

Co-authored-by: liach <liach@users.noreply.github.com>
2020-05-07 22:10:07 +01:00
modmuss50
84cce57f4d 20w19a: Deprecated min/maxDespawnDistance in FabricEntityTypeBuilder as they are no longer applicable to the EntityType.
This was done to keep mod compat and will be removed very shortly. I dont think they were used by many mods (only added in a recent 1.16 snapshot) so I think this is the best course of action.
2020-05-06 18:46:36 +01:00
liach
655c8d6a5c
Fix javadoc jar generation and javadoc building (#550)
* Update build.gradle for testing

Signed-off-by: liach <liach@users.noreply.github.com>

* Fix javadocs

Signed-off-by: liach <liach@users.noreply.github.com>

Co-authored-by: liach <liach@users.noreply.github.com>
2020-04-05 15:07:27 +01:00
modmuss50
2f56dff236 Initial port to 20w09a 2020-02-26 19:10:16 +00:00
modmuss50
7d8ccbd715
Fix ForwardingBakedModel not forwarding isSideLit. Closes #501 (#502)
* Fix ForwardingBakedModel not forwarding isSideLit. Closes #501

* Remove unused DamageModel

* Bump version
2020-02-10 17:07:06 +00:00
modmuss50
aea78a258d 1.15.2 2020-01-21 15:16:39 +00:00
modmuss50
203491ea23 1.15.2-pre1 2020-01-14 20:50:51 +00:00