-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
status effect handling; including cursed status effect icon mixins
- Loading branch information
Showing
9 changed files
with
81 additions
and
99 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/java/de/dafuqs/spectrum/helpers/StatusEffectHelper.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,31 @@ | ||
package de.dafuqs.spectrum.helpers; | ||
|
||
import de.dafuqs.spectrum.*; | ||
import de.dafuqs.spectrum.api.status_effect.*; | ||
import de.dafuqs.spectrum.registries.*; | ||
import net.minecraft.entity.effect.*; | ||
import net.minecraft.util.*; | ||
|
||
public class StatusEffectHelper { | ||
|
||
private static final Identifier INCURABLE_EFFECT_BACKGROUNDS = SpectrumCommon.locate("textures/gui/incurable_effect_backgrounds.png"); | ||
private static final Identifier NIGHT_EFFECT_BACKGROUNDS = SpectrumCommon.locate("textures/gui/night_alchemy_effect_backgrounds.png"); | ||
private static final Identifier DIVINITY_EFFECT_BACKGROUNDS = SpectrumCommon.locate("textures/gui/divinity_effect_backgrounds.png"); | ||
|
||
public static Identifier getTexture(Identifier texture, StatusEffectInstance effect) { | ||
var type = effect.getEffectType(); | ||
|
||
if (type == SpectrumStatusEffects.DIVINITY) | ||
return DIVINITY_EFFECT_BACKGROUNDS; | ||
|
||
if (Incurable.isIncurable(effect) && type != SpectrumStatusEffects.ETERNAL_SLUMBER && type != SpectrumStatusEffects.FATAL_SLUMBER) { | ||
return INCURABLE_EFFECT_BACKGROUNDS; | ||
} | ||
|
||
if (type.isIn(SpectrumStatusEffectTags.NIGHT_ALCHEMY)) | ||
return NIGHT_EFFECT_BACKGROUNDS; | ||
|
||
return texture; | ||
} | ||
|
||
} |
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
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
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
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