-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from IcarussOne/main
Untipped Arrow Particles Bugfix
- Loading branch information
Showing
5 changed files
with
51 additions
and
0 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
35 changes: 35 additions & 0 deletions
35
.../mod/acgaming/universaltweaks/bugfixes/entities/arrow/mixin/UTEntityTippedArrowMixin.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,35 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.entities.arrow.mixin; | ||
|
||
import net.minecraft.entity.projectile.EntityTippedArrow; | ||
import net.minecraft.init.PotionTypes; | ||
import net.minecraft.potion.PotionEffect; | ||
import net.minecraft.potion.PotionType; | ||
|
||
import java.util.Set; | ||
|
||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
// MC-107941 | ||
// https://bugs.mojang.com/browse/MC-107941 | ||
// Courtesy of fonnymunkey | ||
@Mixin(EntityTippedArrow.class) | ||
public abstract class UTEntityTippedArrowMixin | ||
{ | ||
@Shadow | ||
private PotionType potion; | ||
@Shadow | ||
@Final | ||
private Set<PotionEffect> customPotionEffects; | ||
|
||
@Redirect(method = "refreshColor", at = @At(value = "INVOKE", target = "Ljava/lang/Integer;valueOf(I)Ljava/lang/Integer;")) | ||
public Integer utTippedArrowRefreshColor(int i) | ||
{ | ||
if (UTConfigBugfixes.ENTITIES.utUntippedArrowParticlesToggle && potion == PotionTypes.EMPTY && customPotionEffects.isEmpty()) return -1; | ||
return i; | ||
} | ||
} |
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/resources/mixins.bugfixes.entities.untippedarrowparticles.json
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,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.bugfixes.entities.arrow.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTEntityTippedArrowMixin"] | ||
} |