Commit graph

121 commits

Author SHA1 Message Date
modmuss50
06274a4716 Test fix: Object Builder API's Testmod crashing on windows. Closes #3480 2023-12-27 12:58:09 +00:00
modmuss
78d798af9d
Update to loader 0.15 (#3451) 2023-12-08 15:19:17 +00:00
apple502j
a2e8758a92
23w45a porting fixes (#3421) 2023-11-16 16:11:10 +00:00
modmuss50
23e8616e74 23w45a 2023-11-08 16:26:36 +00:00
Shnupbups
acb5cc4ef8 Fix FabricBlockSettings copyOf missing settings (#3373)
Fixes FabricBlockSettings' copyOf method missing several new settings introduced as a result of the removal of Materials.

Specifically, burnable, liquid, forceNotSolid, forceSolid, pistonBehavior, instrument, and replaceable. These are all copied by the vanilla `BlockSettings.copy` as well.
The emissiveLightingPredicate is also now copied in vanilla, so I moved the copy of that to reflect that change.

(cherry picked from commit 2ff98d3bac)
2023-10-22 13:42:40 +01: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
13986bf795 23w41a 2023-10-11 16:56:02 +01:00
apple502j
72c64fc180
Fix 23w40a port issues (#3374)
* Fix testmod calling Text#translatable with non-primitive arg

* Fix javadoc in BlockPickInteractionAware

There is no immediate need to change the param type, as the
world can be obtained from `player.getWorld()`.

* Fix unload events not running during reconfiguration
2023-10-11 16:21:23 +01:00
modmuss50
10292b95f5 23w40a 2023-10-05 09:45:32 +01:00
modmuss
b1b4f7b0a2
Handle null being passed as the datafix type to PersistentState.Type (#3328)
* Handle null being passed as the datafix type to PersistentState.Type

Closes #3327

* Checkstyle ;-)

* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/PersistentStateManagerMixin.java

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

---------

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-09-21 19:16:22 +01:00
apple502j
219ee513db
Support trade rebalance experiment (#3311)
* Support trade rebalance experiment

* Add pool IDs

* Delayed pool modification

* Fix unused import
2023-09-21 19:16:10 +01:00
modmuss
fce67b32cf
23w35a (#3292) 2023-08-31 12:50:38 +01:00
modmuss
86b12645b9
23w31a 2023-08-07 09:09: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
Shnupbups
6beca848ff
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
2023-07-03 13:10:39 +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
fb8d95dacb Split test mods into client and common. (#3033) 2023-05-01 14:04:29 +01:00
modmuss50
b3f2574b16 23w17a 2023-04-26 18:18:06 +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
modmuss50
848ffaabb4 23w13a 2023-03-29 16:07:13 +01:00
modmuss50
d537279b82 23w12a 2023-03-22 17:01:08 +00:00
Shnupbups
63b515f4db
BlockSetTypeRegistry and WoodTypeRegistry (#2916)
* BlockSetTypeRegistry and WoodTypeRegistry

Adds `BlockSetTypeRegistry` for creating `BlockSetType`s using Identifiers.
Also adds `WoodTypeRegistry` to replace `SignTypeRegistry`, matching the new more accurate Yarn name. The old `SignTypeRegistry` remains as deprecated for compatibility.

Also updates Yarn build.

* Delete SignTypeRegistry.java

Broke in the update anyway, no use keeping it

* Suggestions

* Whoops

* Suggestions
2023-02-22 12:54:42 +00:00
modmuss50
e45f7c6532 23w07a 2023-02-15 19:54:58 +00:00
modmuss50
57338cbe24 23w06a 2023-02-08 17:54:34 +00:00
Mark
81af046eba [1.19.3] Implement custom SignTypes (#2832)
* 1.19.3 custom sign types

Co-authored-by: AlphaMode <26313415+alphamode@users.noreply.github.com>

* fix mixin name

Co-authored-by: AlphaMode <26313415+alphamode@users.noreply.github.com>
(cherry picked from commit eb2a3ba986)
2023-01-20 18:01:07 +00:00
apple502j
85f102ee1a
Object builder API updates (#2798)
* Add feature support to FabricEntityTypeBuilder

* Use IdentityHashMap for EntityType-keyed maps

* Improve tests

* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/FabricEntityTypeBuilder.java

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

* Fix naming of static-final field

* Address some reviews

* Rebuild

* Split gametest

* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/MinecartComparatorLogicRegistry.java

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-01-02 13:05:10 +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
apple502j
f1e4495b13
Javadoc and typo fixes (#2782) 2022-12-23 15:20:04 +00:00
apple502j
e9dee004f1
Refactor FabricBlockSettings to copy and override new stuff (#2741)
* Copy new block settings

* Sort method calls in copy method

* Add more overrides
2022-12-11 13:50:59 +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
triphora
06e0e251a9
Implement a version of FabricDefaultAttributeRegistry#register that takes a DefaultAttributeContainer (#2589)
Refer to https://github.com/orgs/FabricMC/discussions/2587 for motivations :)
2022-11-07 18:30:06 +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
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
Shnupbups
42d99c329d
Add many more transitive access wideners (#2341)
- `DamageSource` constructor and methods made accessible - supersedes #1085
- `SpawnRestriction` method `register` made accessible - allows `SpawnRestrictionAccessor` mixin to be removed
- `TradeOffers` trade factory inner classes made accessible
- `Material$Builder` methods made accessible (except `lightPassesThrough` method as that would break binary compat in `FabricMaterialBuilder`
- Fixed `generateAccessWideners` task for TAWs module so it can now find the jar
- `AxeItem`, `MusicDiscItem`, and `PickaxeItem` constructors made accessible
- `ItemUsageContext` and `ItemPlacementContext` alternate constructors made accessible - allows passing a `null` PlayerEntity
- `Factory` inner classes of both `CookingRecipeSerializer` and `CuttingRecipeSerializer` made accessible
- `BrewingRecipeRegistry` methods `registerItemRecipe`, `registerPotionType`, and `registerPotionRecipe` made accessible
- `ScoreboardCriterion` `create` methods made accessible
- `ModelPart` inner classes `Vertex` and `Quad` made accessible
- `RenderLayer` `of` method made accessible
- `SensorType` and `Activity` constructors made accessible
- `LivingEntity` methods `damageArmor`, `damageHelmet`, and `damageShield` made accessible
- `ProjectileEntity` constructor made accessible
- `FishingBobberEntity` alternate constructor made accessible - allows passing luck of the sea or lure levels for custom fishing bobbers
- `ServerWorld` method `sendToPlayerIfNearby` made accessible
- `TextColor` method `getHexCode` made accessible
- `TranslatableTextContent` method `getArg` made accessible
2022-08-15 18:41:18 +01:00
apple502j
7675279697 Fix POI types not being registered properly 2022-08-06 19:12:46 +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
Technici4n
1e232e13ae
Move a few object builders to transitive AWs (#2154)
* Move a few object builders to transitive AWs

* Remove outdated access widener

* Remove controversial deprecation of FabricBlockEntityTypeBuilder
2022-08-06 19:01:41 +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
Player
f71b366fb1
Update command registration API to reflect 1.19 vanilla changes (#2227)
* Update command registration API to reflect vanilla changes

* Allow module versions in impl+mixin packages

* Use v2 module, keeping v1 for server commands at least

* update, address review

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2022-05-20 18:39:10 +01:00
modmuss50
51821d6d14 Copy offsetType in FabricBlockSettings 2022-05-20 18:29:19 +01:00
Luligabi1
1e43a8d519 Fix #1947, #1873: FabricBlockSettings#copy does not copy all settings, the sequel (#2119)
* Fix FabricMC#1947, FabricMC#1873

* Ordered import to follow checkstyle

* Removed broken 1.18 code on 1.18.2 branch

* Added note specyfing that FabricBlockSettings copies settings Block.Settings doesn't.

(cherry picked from commit 032c981de8)
2022-05-20 18:19:41 +01:00
modmuss50
55043e695a 1.19-pre1 2022-05-18 19:16:52 +01:00
modmuss50
55e82473ab 22w19a 2022-05-12 21:58:35 +01:00