generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport from 1.21.2+
- Loading branch information
Showing
9 changed files
with
119 additions
and
11 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
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
7 changes: 7 additions & 0 deletions
7
src/main/java/com/provismet/provihealth/interfaces/IMixinLivingEntity.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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
package com.provismet.provihealth.interfaces; | ||
|
||
import net.minecraft.entity.effect.StatusEffect; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
|
||
import java.util.List; | ||
|
||
public interface IMixinLivingEntity { | ||
public float provihealth_glideHealth (float glideFactor); | ||
|
||
public float provihealth_glideVehicle (float trueValue, float glideFactor); | ||
|
||
List<RegistryEntry<StatusEffect>> provi_Health$getClientSideStatusEffects (); | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/provismet/provihealth/util/StatusEffectIdentifier.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,22 @@ | ||
package com.provismet.provihealth.util; | ||
|
||
import net.minecraft.entity.effect.StatusEffect; | ||
import net.minecraft.particle.EntityEffectParticleEffect; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.minecraft.util.math.ColorHelper; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public abstract class StatusEffectIdentifier { | ||
private static final Map<Integer, RegistryEntry<StatusEffect>> colourToEffect = new HashMap<>(); | ||
|
||
public static RegistryEntry<StatusEffect> fromParticleEffect (EntityEffectParticleEffect particleEffect) { | ||
return colourToEffect.getOrDefault(particleEffect.color, null); | ||
} | ||
|
||
public static void setup () { | ||
Registries.STATUS_EFFECT.streamEntries().forEach(effect -> colourToEffect.putIfAbsent(ColorHelper.Argb.fullAlpha(effect.value().getColor()), effect)); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
accessWidener v2 named | ||
|
||
accessible method net/minecraft/client/gui/DrawContext drawTexturedQuad (Lnet/minecraft/util/Identifier;IIIIIFFFF)V | ||
accessible method net/minecraft/client/gui/DrawContext drawTexturedQuad (Lnet/minecraft/util/Identifier;IIIIIFFFFFFFF)V | ||
accessible method net/minecraft/client/gui/DrawContext drawTexturedQuad (Lnet/minecraft/util/Identifier;IIIIIFFFFFFFF)V | ||
accessible field net/minecraft/particle/EntityEffectParticleEffect color I |