Enchantment API ()

* ALLOW_ENCHANTING event

* Intrinsic enchantments + testmod

also fixed a bug in the testmod that prevented the custom damage handler from ever working

* Item-based override mechanism

* Replaces part of the use cases of the event with a convenient method to override in FabricItem.
* Updated and tested the testmod.

* javadoc

* Move event logic to FabricItemStack

* oops

* Simplify mixin

* Replace ActionResult with TriState

* Use TriState in testmod

* requests

* Clarify jdoc

* Ship without intrinsic enchantments at first

* Checkstyle

* Checkstyle

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
This commit is contained in:
Syst3ms 2024-04-11 00:02:11 +02:00 committed by GitHub
parent 6793dde117
commit 8f5205a8a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 390 additions and 14 deletions
fabric-object-builder-api-v1/src/test/java/net/fabricmc/fabric/test/object/builder

View file

@ -20,10 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import net.minecraft.entity.SpawnLocation;
import net.minecraft.entity.SpawnLocationTypes;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@ -33,6 +29,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.entity.SpawnLocationTypes;
import net.minecraft.entity.SpawnRestriction;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.attribute.DefaultAttributeRegistry;