Commit graph

36 commits

Author SHA1 Message Date
Juuxel
e747827905
Loot table API v2, iteration 2 (#1241)
* Improve loot table API

Alternative to #629.

- Deprecates all classes and methods that use outdated Yarn names.
- Adds FabricLootTable and FabricLootTableBuilder to replace
  the LootSupplier naming variants.
- Deprecates LootEntryTypeRegistry and LootJsonParser
  as their functionality is exposed in vanilla now.
- Adds methods to FabricLootPoolBuilder for working
  with collections as builder parameters.
- FabricLootPool and FabricLootTable/Supplier now return immutable lists
  instead of modifiable fixed-size ones.

Still WIP: LootTableLoadingCallback uses the deprecated FabricLootSupplier.

Update fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootTableBuilder.java

Co-authored-by: i509VCB <i509vcb@gmail.com>

Fix compilation

Create loot table API v2

Move incorrect classes and revert unnecessary change

Add test for replacing loot tables

Document FabricLootPools

builder() -> create()

Add accessor for LootPool.bonusRolls

Add loot pool builder method for bonus rolls

Use Blocks.DIRT.getLootTableId() instead of raw string in v1 loot test mod

Make links in deprecation docs cleaner

Make FabricLootPoolBuilder.copyFrom(pool, true) also copy bonus rolls

...and mention it in the javadoc

Remove copyFrom from v2 builders

It seems like a maintainability mess if Mojang ever decides
to extend loot tables, and the chosen boolean flags are arbitrary.
It also doesn't really have use cases apart from the internal use
in the copyOf methods, and even then users can replicate its functionality
with the other API methods.

Rename 'supplier' to 'table' in LootManagerMixin

Add 'stable' lifecycle to loot-table-api-v2, deprecate v1

Add internal comment for implementors about updates

Cancel all remaining callbacks when a loot table is replaced

Remove unused shadowed logger from LootManagerMixin

Migrate subproject versioning to new system

Start the AW migration

Update test mod

* Use interface injection

* Fix some issues

* Remove outdated bonusRolls test from LootTest

It's a vanilla feature now.

* Create transitive access widener module

* Replace LootTableLoadingCallback with two events

* Use friendlier exception message

* Add resource source tracking

* Add loot table sources

* Add resource pack source for DefaultResourcePack$1 (anon resource)

* Add license header

* Make FabricResource an internal API in resource loader

* Remove my TAW module

* Add loot table-related TAWs

* Run CI

* Fix LootUtil.determineSource giving null values

* Clarify LootUtil comment

* Rename loot-table-api => loot-api + minor comment changes

* Add README

* Fix mixin file name

* Use ImmutableMap.Builder instead of HashMap.computeIfAbsent in loot event impl

* Prefix accessor methods with fabric_ to prevent conflicts with loot v1

* Document mixins

* Document mixins more extensively

* Improve NRMMixin comments

* Change weird wording in FabricResourceImpl

* Minor updates

- Support new built-in mod respack source
- Fix ResourceMixin comment
- Add more docs to LootTableEvents.MODIFY
- Add package-info

* Add license header
2022-05-31 12:12:10 +01:00
modmuss50
d7c144a830
Migrate to SLF4j and update loom (#1960)
* Migrate to SLF4j and update loom

* Update loom

* Update to latest loom
2022-01-30 21:37:23 +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
c3150579ea Bump version 2021-11-06 20:31:21 +00:00
modmuss50
8a8e3d81de Ensure that API implementations can never be null. 2021-11-06 20:12:45 +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
a02b4463f9 21w19a 2021-05-12 20:23:04 +01:00
modmuss50
92519afafe Version bump 2021-01-19 19:38:22 +00: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
modmuss50
0c3d83a544 20w48a - Just mapping updates 2020-11-25 19:34:48 +00:00
Thalia Nero
9f7a7423f3 Add module dependencies to maven POM (#1104) 2020-11-15 19:46:01 +00:00
modmuss50
df3673f0bc 20w46a 2020-11-11 20:18:14 +00:00
modmuss50
432ea188f9 Bump version 2020-09-03 20:00:01 +01:00
i509VCB
0ba3dd89ec
Add item renderer with model transformation mode, deprecate old one. (#973)
* Add item renderer with model transformation mode, deprecate old one.

This PR simply adds a new interface which supplies the additional `Mode` parameter.
All old renderers are delegated to an implementation of the new renderer, thereby making this PR still backwards compatable with all existing renderers.

(cherry picked from commit 7c9162e99f48c6e3989eec9a46afaa935d65ce30)

* Update fabric-rendering-v1/src/main/java/net/fabricmc/fabric/api/client/rendering/v1/BuiltinItemRendererWithMode.java

Co-authored-by: shartte <shartte@users.noreply.github.com>

* Rename new interfact to `DynamicItemRenderer`, make it an inner class of the registry class.

* Update fabric-rendering-v1/src/main/java/net/fabricmc/fabric/impl/client/rendering/BuiltinItemRendererRegistryImpl.java

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

* Update BuiltinItemRendererRegistryImpl.java

* Update BuiltinItemRendererRegistryImpl.java

* Imports

* Use ItemConvertible for new render method

* Rename new interfact to `DynamicItemRenderer`, make it an inner class of the registry class.

fabric-rendering-v1/src/main/java/net/fabricmc/fabric/api/client/rendering/v1/BuiltinItemRendererRegistry.java

* Move inner class out, fix formatting issue in loot-tables with linux oses

* why was this multilined

* license header lol

* Apply suggestions from code review

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

* Make renderer a nested class again

* putIfAbsent

Co-authored-by: shartte <shartte@users.noreply.github.com>
Co-authored-by: liach <7806504+liach@users.noreply.github.com>
2020-09-03 19:47:50 +01:00
Joseph Burton
fac8f36647
Fix loot table API for 1.16 (#832)
* Fix loot table API for 1.16

* Bump module version to 1.0.0

* Apply review suggestions
2020-07-12 19:32:22 +01:00
modmuss50
059ea866ec update mappings 2020-06-09 22:29:07 +01:00
modmuss50
0d474ec430 1.16-pre1 2020-06-04 21:20:20 +01:00
modmuss50
da175ad6ad 20w22a 2020-05-29 15:56:10 +01:00
modmuss50
6d41837a96 20w20a 2020-05-13 18:42:14 +01:00
modmuss50
2f56dff236 Initial port to 20w09a 2020-02-26 19:10:16 +00:00
modmuss50
e08a7305d5 1.15-pre2 2019-11-25 19:28:07 +00:00
Player
b7f9825dbb Add checkstyle verification for package names, fix non-API packages. 2019-11-03 20:14:45 +01:00
modmuss50
ce77399215 19w44a
Only yarn renames
2019-10-30 17:10:30 +00:00
Player
dfdb52d6e5 Add checkstyle, format existing code accordingly. 2019-10-27 15:40:26 +01:00
Modmuss50
9c45b1ef78 Wip 19w39a (#386)
* 19w39a fixes (#387)

* Bump versions

* Breaks: BlockEntityRendererRegistry and EntityRendererRegistry

* Remove broken parts of rendering, bump major version

* Add renderer-registries, replaces broken parts of rendering api

* Slap a band-aid on renderer/Indigo - won't render properly, but runs

* Bump distribution versions, add renderer-registries to main build

* Clean up blockrenderlayer implementation package name
2019-09-28 18:07:04 -07:00
grondag
d2ac651a7a
19w38b API Fixes (#370)
* Fix compilation errors (untested)

* Random fixes

* Various modded rendering fixes

* Restore contract of RenderAttachedBlockView

* Bump versions as needed

* Add API for BlockRenderLayer

* Minor format / name cleanup

Will do a more comprehensive pass as part of separate refactor PR

* Bump versions not handled earlier

* Bump loader/mc bounds for dependent modules

* Update fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/v1/BlockRenderLayerMapImpl.java

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* Update fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/v1/BlockRenderLayerMapImpl.java

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* Minor clean ups

* Improve docs, minor format corrections.

* Update MC dependency
2019-09-20 16:50:49 -07:00
modmuss50
9c15c890d1 Update mappings 2019-09-18 19:01:22 +01:00
modmuss50
7533b848b5 19w38b - start the port, does not compile just yet. 2019-09-18 18:16:25 +01:00
Prospector
5ed88c193a Add more metadata to the modules (#353)
* Add fabric-api-base as a dep to fabric-networking-v0
2019-09-09 01:48:43 +02:00
svipthedrunk
b494ebebbb Fixed most of the javadoc comments and removed unused imports
Mostly replaced instances of > with its correct html representation "&gt;"
Changed or removed some bad @link entries, mostly stuff due to overseen code changes
Could not find the referenced class VertexEditor at all, removed these references out of the docs

Some errors still exists due to referenced objects not in the classpath at the time the javadoc is build
Proposal do some gradle magic
2019-06-27 18:18:10 +02:00
modmuss50
43028fa68d Fix fabric-loot-tables-v1 not having a build hash 2019-06-24 19:50:26 +01:00
Adrian Siekierka
f0d568005e 1.14.3-pre2 2019-06-13 10:16:42 +02:00
asie
c189dc5c11 fix license headers 2019-06-10 07:25:37 +02:00
Juuxel
05f11b75e4 Loot table manipulation API (#160) 2019-06-09 21:47:28 +02:00