-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored Tater Effect registration and updated docs (#224)
* Refactored Tater Effect registration and updated docs Refactored Tater Effect to use RegistryEntry, since the StatusEffect itself isn't used much anymore. Updated related potion usage to reflect this change. Enhanced documentation with detailed instructions on applying effects programmatically. * Refactor effects documentation for clarity and structure Updated effects section to improve readability and consistency. Introduced a table format for argument descriptions and refined terminology for better understanding. * Satisfy the building process * Update develop/entities/effects.md Co-authored-by: Miroma <[email protected]> * Update develop/entities/effects.md * Add ReferenceMethods class for version-aware method access This commit introduces a static utility class to centralize version-aware internal method references, starting with `addTaterEffect`. Additionally, updated documentation now transcludes the new method for consistent and maintainable reference examples. * Satisfy the building process --------- Co-authored-by: Manchick0 <[email protected]> Co-authored-by: Calum H. <[email protected]> Co-authored-by: Miroma <[email protected]>
- Loading branch information
1 parent
f2a45b6
commit 787ead4
Showing
4 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
reference/latest/src/main/java/com/example/docs/ReferenceMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example.docs; | ||
|
||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.effect.StatusEffectInstance; | ||
|
||
import com.example.docs.effect.FabricDocsReferenceEffects; | ||
|
||
/** | ||
* A static-first class, used solely to provide version-aware | ||
* references to internal methods. | ||
*/ | ||
public class ReferenceMethods { | ||
public static void addTaterEffect(LivingEntity entity) { | ||
// :::1 | ||
var instance = new StatusEffectInstance(FabricDocsReferenceEffects.TATER, 5 * 20, 0, false, true, true); | ||
entity.addStatusEffect(instance); | ||
// :::1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters