-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix off by one int clamp in Witchery's glyph rendering (#448)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
319191c
commit ad9680d
Showing
3 changed files
with
31 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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/mitchej123/hodgepodge/mixins/late/witchery/MixinBlockCircleGlyph.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,23 @@ | ||
package com.mitchej123.hodgepodge.mixins.late.witchery; | ||
|
||
import net.minecraft.util.IIcon; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
import com.emoniph.witchery.blocks.BlockCircleGlyph; | ||
|
||
@Mixin(BlockCircleGlyph.class) | ||
public class MixinBlockCircleGlyph { | ||
|
||
@Shadow(remap = false) | ||
private IIcon[] icons; | ||
|
||
@ModifyConstant(method = "getIcon(II)Lnet/minecraft/util/IIcon;", constant = @Constant(intValue = 12)) | ||
private int hodgepodge$fixMetadataClamp(int oldValue) { | ||
return icons.length - 1; | ||
} | ||
|
||
} |