Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit babc466

Browse files
committed
Checkstyle fixes to patchwork-extensions
1 parent e4b8260 commit babc466

4 files changed

Lines changed: 55 additions & 44 deletions

File tree

patchwork-extensions/src/main/java/com/patchworkmc/mixin/extension/MixinStatusEffect.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919

2020
package com.patchworkmc.mixin.extension;
2121

22-
import net.minecraft.entity.effect.StatusEffect;
2322
import net.minecraftforge.common.extensions.IForgeEffect;
2423
import org.spongepowered.asm.mixin.Mixin;
2524

25+
import net.minecraft.entity.effect.StatusEffect;
26+
2627
@Mixin(StatusEffect.class)
2728
public class MixinStatusEffect implements IForgeEffect {
2829
}

patchwork-extensions/src/main/java/net/minecraftforge/common/extensions/IForgeEffect.java

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,62 +33,74 @@
3333
import net.fabricmc.api.Environment;
3434

3535
public interface IForgeEffect {
36-
3736
default StatusEffect getEffect() {
3837
return (StatusEffect) this;
3938
}
4039

4140
/**
42-
* If the Potion effect should be displayed in the players inventory
43-
* @param effect the active PotionEffect
41+
* Returns true if the {@link StatusEffectInstance} should be displayed in the player's inventory.
42+
*
43+
* @param effect the active {@link StatusEffectInstance}
4444
* @return true to display it (default), false to hide it.
4545
*/
46-
default boolean shouldRender(StatusEffectInstance effect) { return true; }
46+
default boolean shouldRender(StatusEffectInstance effect) {
47+
return true;
48+
}
4749

4850
/**
49-
* If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
50-
* @param effect the active PotionEffect
51+
* Returns true if the {@link StatusEffectInstance} text (name and duration) should be drawn when this {@link StatusEffect} is active.
52+
*
53+
* @param effect the active {@link StatusEffectInstance}
5154
* @return true to draw the standard text
5255
*/
53-
default boolean shouldRenderInvText(StatusEffectInstance effect) { return true; }
56+
default boolean shouldRenderInvText(StatusEffectInstance effect) {
57+
return true;
58+
}
5459

5560
/**
56-
* If the Potion effect should be displayed in the player's ingame HUD
57-
* @param effect the active PotionEffect
61+
* Returns true if the {@link StatusEffectInstance} should be displayed in the player's {@link net.minecraft.client.gui.hud.InGameHud}.
62+
*
63+
* @param effect the active {@link StatusEffectInstance}
5864
* @return true to display it (default), false to hide it.
5965
*/
60-
default boolean shouldRenderHUD(StatusEffectInstance effect) { return true; }
66+
default boolean shouldRenderHUD(StatusEffectInstance effect) {
67+
return true;
68+
}
6169

6270
/**
63-
* Called to draw the this Potion onto the player's inventory when it's active.
64-
* This can be used to e.g. render Potion icons from your own texture.
71+
* Called to draw the {@link StatusEffectInstance} onto the player's inventory when it's active.
72+
* This can be used to e.g. render {@link StatusEffect} icons from your own texture.
6573
*
66-
* @param effect the active PotionEffect
67-
* @param gui the gui instance
68-
* @param x the x coordinate
69-
* @param y the y coordinate
70-
* @param z the z level
74+
* @param effect the active {@link StatusEffectInstance}
75+
* @param gui the gui instance
76+
* @param x the x coordinate
77+
* @param y the y coordinate
78+
* @param z the z level
7179
*/
7280
@Environment(EnvType.CLIENT)
73-
default void renderInventoryEffect(StatusEffectInstance effect, AbstractInventoryScreen<?> gui, int x, int y, float z) { }
81+
default void renderInventoryEffect(StatusEffectInstance effect, AbstractInventoryScreen<?> gui, int x, int y, float z) {
82+
}
7483

7584
/**
76-
* Called to draw the this Potion onto the player's ingame HUD when it's active.
77-
* This can be used to e.g. render Potion icons from your own texture.
78-
* @param effect the active PotionEffect
79-
* @param gui the gui instance
80-
* @param x the x coordinate
81-
* @param y the y coordinate
82-
* @param z the z level
83-
* @param alpha the alpha value, blinks when the potion is about to run out
85+
* Called to draw the {@link StatusEffectInstance} onto the player's {@link net.minecraft.client.gui.hud.InGameHud} when it's active.
86+
* This can be used to e.g. render {@link StatusEffect} icons from your own texture.
87+
*
88+
* @param effect the active {@link StatusEffectInstance}
89+
* @param gui the gui instance
90+
* @param x the x coordinate
91+
* @param y the y coordinate
92+
* @param z the z level
93+
* @param alpha the alpha value, blinks when the {@link StatusEffect} is about to run out
8494
*/
8595
@Environment(EnvType.CLIENT)
86-
default void renderHUDEffect(StatusEffectInstance effect, DrawableHelper gui, int x, int y, float z, float alpha) { }
96+
default void renderHUDEffect(StatusEffectInstance effect, DrawableHelper gui, int x, int y, float z, float alpha) {
97+
}
8798

8899
/**
89-
* Get a fresh list of items that can cure this Potion.
90-
* All new PotionEffects created from this Potion will call this to initialize the default curative items
91-
* @return A list of items that can cure this Potion
100+
* Returns a fresh list of items that can cure this {@link StatusEffect}.
101+
* All new {@link StatusEffectInstance}s created from this {@link StatusEffect} will call this to initialize the default curative items.
102+
*
103+
* @return A list of items that can cure this {@link StatusEffect}
92104
*/
93105
default List<ItemStack> getCurativeItems() {
94106
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
@@ -97,12 +109,13 @@ default List<ItemStack> getCurativeItems() {
97109
}
98110

99111
/**
100-
* Used for determining {@code PotionEffect} sort order in GUIs.
101-
* Defaults to the {@code PotionEffect}'s liquid color.
102-
* @param potionEffect the {@code PotionEffect} instance containing the potion
103-
* @return a value used to sort {@code PotionEffect}s in GUIs
112+
* Used for determining {@link StatusEffectInstance} sort order in GUIs.
113+
* Defaults to the {@link StatusEffectInstance}'s liquid color.
114+
*
115+
* @param effect the {@link StatusEffectInstance} containing the {@link StatusEffect}
116+
* @return a value used to sort {@link StatusEffectInstance}s in GUIs
104117
*/
105-
default int getGuiSortColor(StatusEffectInstance potionEffect) {
118+
default int getGuiSortColor(StatusEffectInstance effect) {
106119
return getEffect().getColor();
107120
}
108121
}

patchwork-extensions/src/main/resources/fabric.mod.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
"schemaVersion": 1,
33
"id": "patchwork-extensions",
44
"version": "${version}",
5-
65
"name": "Patchwork Extensions",
76
"description": "Starts Patchwork mods",
87
"authors": [
9-
"coderbot"
8+
"coderbot"
109
],
11-
1210
"license": "LGPL-2.1-only",
1311
"icon": "assets/patchwork-dispatcher/icon.png",
14-
1512
"environment": "*",
1613
"depends": {
17-
"fabricloader": ">=0.4.0",
18-
"fabric": "*"
14+
"fabricloader": ">=0.4.0",
15+
"fabric": "*"
1916
},
2017
"mixins": [
2118
"patchwork-extensions.mixins.json"

patchwork-extensions/src/main/resources/patchwork-extensions.mixins.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"package": "com.patchworkmc.mixin.extension",
44
"compatibilityLevel": "JAVA_8",
55
"mixins": [
6-
"MixinStatusEffect"
6+
"MixinStatusEffect"
77
],
88
"injectors": {
9-
"defaultRequire": 1
9+
"defaultRequire": 1
1010
}
1111
}

0 commit comments

Comments
 (0)