Commit graph

59 commits

Author SHA1 Message Date
modmuss
d6f2b0841c
Stack aware getFoodComponent (#3520)
* Stack aware `getFoodComponent`

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>

* Back to redirects

---------

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>
2024-01-15 13:39:30 +00:00
modmuss
78d798af9d
Update to loader 0.15 (#3451) 2023-12-08 15:19:17 +00:00
modmuss
9468a19de0
Configure spotless for imports, sort imports. (#3365)
* Configure spotless to also do imports. Allows for auto applying.

* Order imports
2023-10-22 13:35:58 +01:00
modmuss50
435112151c 1.20.2-pre1 2023-09-05 16:31:02 +01:00
modmuss
fce67b32cf
23w35a (#3292) 2023-08-31 12:50:38 +01:00
modmuss
f4b7e42468
Update to loom 1.3 and use Mod Publish Plugin (#3158)
* Update to loom 1.3

* Fix more 1.3 deprecations

* Opps

* Move to mod publish plugin

* Revert some changes

* Fix some more Gradle deprecations

* Fix names

* Remove extra stuff

* Cleanup
2023-08-02 18:51:21 +01:00
modmuss
b3afc78b68
Setup unit tests & format gradle files. (#3073) 2023-05-30 13:07:11 +01:00
modmuss50
4d8536c91f
Add and test for missing method overrides in FabricBlockSettings (#3056) 2023-05-11 09:25:08 +01:00
modmuss50
03ef495b7f 1.20-pre1 2023-05-10 14:51:08 +01:00
modmuss50
fb8d95dacb Split test mods into client and common. (#3033) 2023-05-01 14:04:29 +01:00
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
modmuss50
158c189089 23w14a 2023-04-05 17:18:33 +01:00
Juuz
09a3510c69
EquipmentSlotProvider: Add javadoc link to getPreferredEquipmentSlot (#2935) 2023-03-15 09:14:00 +00:00
modmuss50
ae0966baae
Fix all valid Mixin AP warnings. (#2914) 2023-02-22 12:54:50 +00:00
modmuss50
57338cbe24 23w06a 2023-02-08 17:54:34 +00:00
modmuss50
12a6ba2c15 23w05a 2023-02-01 16:35:59 +00:00
modmuss50
28efac3df2 Fix vanilla behaviour change causing Dragon Breath's to leave an empty Glass Bottle in Brewing Stand (#2874)
This fix restores the previouslly broken behaviour of item remainders in brewing stands.

(cherry picked from commit 312c329484)
2023-01-31 10:20:25 +00:00
modmuss50
a1ccd7bfed 23w04a 2023-01-24 16:59:43 +00:00
Technici4n
364b4f31bd Fix ItemStack.EMPTY.getItem() rarely returning null due to threading (#2826)
* Fix ItemStack.EMPTY.getItem() rarely returning null due to threading

* Overwrite instead

(cherry picked from commit c3530bb1c6)
(cherry picked from commit 693ffc0581)
2023-01-20 18:08:23 +00:00
Technici4n
1134c5b850
Remove leftover @ApiStatus.Internal annotations and add annotation validation (#2825)
* Remove leftover `@ApiStatus.Internal` annotations and add annotation validation

* Simplify

* Simplify more

* Update gradle/validate-annotations.gradle

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-01-05 12:50:15 +00:00
Silver
e498f5f0a9
Replace old nullability comments with annotations (#2800)
* Replace useless nullability comments with jetbrains annotation

* These were old comments

* Revert "These were old comments"

This reverts commit 4e9555ad51.

* checkstyle + nullability in mixin
2023-01-02 13:04:34 +00:00
modmuss50
99f9db8063
Cleanup Environment annotation usage. (#2755)
* Remove @Environment(EnvType.CLIENT) from BoundedIntRule.validate

* Move ItemTooltipCallback to client source set

* Remove @Environment(EnvType.CLIENT) annotation

* Remove @Environment(EnvType.SERVER) from WorldChunkMixin
2022-12-23 13:10:16 +00:00
apple502j
4d2c60634d
Item API: override Item.Settings#requires (#2745) 2022-12-11 13:52:01 +00:00
modmuss50
fa25da992d 1.19.3-rc1 2022-12-01 15:46:20 +00:00
apple502j
8c84281028
1.19.3-pre2 javadoc fixes (#2698)
* 1.19.3-pre2 javadoc fixes

* Update fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/FabricDataGenerator.java

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

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2022-11-26 19:57:30 +00:00
apple502j
d2e7dd88d0
Fix crash in 1.19.3 stack remainder test port (#2674) 2022-11-20 14:25:31 +00:00
AlphaMode
42048a1d27 Support stack aware recipe remainders (#2556)
* Support stack aware recipe remainders

* Fix checkstyle

* Remove all overwrites

* Add FabricItemStack and make RecipeRemainderHandler thread safe

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

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

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

* Remove hasRecipeRemainder, Update test mod and remove unneeded mixins

* Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java

Co-authored-by: Salvatore Peluso <info@devpelux.xyz>

* Avoid copying the ItemStack

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java

Co-authored-by: Salvatore Peluso <info@devpelux.xyz>

* Sneakily change duplicate keybinding to a less used key

* make everything thread safe and improve AbstractFurnaceBlockEntityMixin

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

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

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java

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

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: Salvatore Peluso <info@devpelux.xyz>

* clear thread local and change field prefix

* forgot the allow

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java

Co-authored-by: Salvatore Peluso <info@devpelux.xyz>

* Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java

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

* Add FurnaceGameTest

* Change test keybind back to LShift

* Fix brewing stand remainder and fix nitpicks

* add code example to remainder javadoc

* Fixed and reformatted docs, changed recipe mixin behavior to store the remainder stack instead of the original stack, refactoring.

* Added gametests for brewing stand and recipe mixins, fixed furnace gametest compairing stacks with themselves.

* Use (0,1,0) position for game tests

* Review changes

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
Co-authored-by: Salvatore Peluso <info@devpelux.xyz>
Co-authored-by: modmuss50 <modmuss50@gmail.com>

(cherry picked from commit fa140d5976)
2022-11-20 13:46:25 +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
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
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
Technici4n
35a03c43c2
Fix inconsistent ordering of item attribute modifiers by using a linked hashmap (#2380) 2022-07-21 20:08:00 +01:00
Daomephsta
767db26ed9 Make getKnockbackResistance() work for all materials (#2129)
* Make getKnockbackResistance() work for all materials

* Add missing license to ArmorItemMixin.java

* Fix all build failures

* Document ArmorItemMixin

(cherry picked from commit 6c4e5d0990)
2022-06-04 21:10:14 +01:00
modmuss50
1899036145 1.19-pre2
All mapping changes.
2022-05-23 17:20:40 +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
frqnny
258778f0e5 Add ModifyItemAttributeModifiersCallback (#2175)
* Add ItemAttributeModifiersCallback

* fix checkstyle errors

* fix checkstyle errors v2

* Edit javadoc per Technician's review

* Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/ItemAttributeModifiersCallback.java

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* Change functional interface name per Juuz's review

* Change name to ModifyItemAttributeModifiers per Juuz and Technician's request

* Forgot to add callback to the name

* Return mutable map

* Remove unused import

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
(cherry picked from commit 85719ab7b7)
2022-05-20 18:19:48 +01:00
modmuss50
ec94c6f636
22w16b
Co-authored-by: Player <player@player.to>
2022-04-20 22:22:10 +01:00
modmuss50
8eae451042 22w15a 2022-04-13 19:03:57 +01:00
modmuss50
0c7c3953f9 Merge remote-tracking branch 'origin/1.18.2' into 1.19 2022-04-10 17:20:49 +01:00
Technici4n
4457765521
Add stack-aware getAttributeModifiers and isSuitableFor to FabricItem (#2090)
* Add stack-aware getAttributeModifiers to FabricItem

* Add stack-aware version of isSuitableFor

* Use the standard attack damage UUID
2022-04-10 16:27:23 +01:00
modmuss50
717abbc48a 22w14a 2022-04-06 21:49:45 +01:00
Technici4n
691a79b5ca Allow canceling the NBT update animation and block break reset (#1790)
* Allow canceling the NBT update animation

* Remove the event and introduce FabricItem instead

* Remove FabricItem and add an item setting instead

* Revert "Remove FabricItem and add an item setting instead"

This reverts commit a93205c927.

After some discussion, it was agreed upon internally that an interface is better than item settings for behavior extensions.

* Add allowContinuingBlockBreaking

* Update ClientPlayerInteractionManagerMixin comment and inject name
2021-12-03 13:38:32 +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
b4f4f6cda4 Update Loom and Loader. Cleanup/improve buildscript. 2021-11-12 15:02:54 +00:00
modmuss50
65d505fc8a Bump versions
All of the version need to be bumped due to fabric-api-base being updated, this highlights the need for a better solution.
2021-11-05 17:09:48 +00: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
modmuss50
a02b4463f9 21w19a 2021-05-12 20:23:04 +01:00
modmuss50
23b3c92ea9 21w13a 2021-03-31 20:52:51 +01:00