forked from IrisShaders/Iris
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.20.3' of https://github.com/IrisShaders/Iris into 1.20.4
- Loading branch information
Showing
45 changed files
with
556 additions
and
803 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/main/java/net/coderbot/batchedentityrendering/mixin/BufferSourceAccessor.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,15 @@ | ||
package net.coderbot.batchedentityrendering.mixin; | ||
|
||
import com.mojang.blaze3d.vertex.BufferBuilder; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.RenderType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.Map; | ||
|
||
@Mixin(MultiBufferSource.BufferSource.class) | ||
public interface BufferSourceAccessor { | ||
@Accessor | ||
Map<RenderType, BufferBuilder> getFixedBuffers(); | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...mixin/ChunkBufferBuilderPackAccessor.java → ...xin/SectionBufferBuilderPackAccessor.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,15 +1,15 @@ | ||
package net.coderbot.batchedentityrendering.mixin; | ||
|
||
import com.mojang.blaze3d.vertex.BufferBuilder; | ||
import net.minecraft.client.renderer.ChunkBufferBuilderPack; | ||
import net.minecraft.client.renderer.SectionBufferBuilderPack; | ||
import net.minecraft.client.renderer.RenderType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.Map; | ||
|
||
@Mixin(ChunkBufferBuilderPack.class) | ||
public interface ChunkBufferBuilderPackAccessor { | ||
@Mixin(SectionBufferBuilderPack.class) | ||
public interface SectionBufferBuilderPackAccessor { | ||
@Accessor | ||
Map<RenderType, BufferBuilder> getBuilders(); | ||
} |
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
120 changes: 120 additions & 0 deletions
120
src/main/java/net/coderbot/iris/gui/OldImageButton.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,120 @@ | ||
package net.coderbot.iris.gui; | ||
|
||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.Button; | ||
import net.minecraft.network.chat.CommonComponents; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class OldImageButton extends Button { | ||
protected final ResourceLocation resourceLocation; | ||
protected final int xTexStart; | ||
protected final int yTexStart; | ||
protected final int yDiffTex; | ||
protected final int textureWidth; | ||
protected final int textureHeight; | ||
|
||
public OldImageButton( | ||
int pImageButton0, int pInt1, int pInt2, int pInt3, int pInt4, int pInt5, ResourceLocation pResourceLocation6, Button.OnPress pButton$OnPress7 | ||
) { | ||
this(pImageButton0, pInt1, pInt2, pInt3, pInt4, pInt5, pInt3, pResourceLocation6, 256, 256, pButton$OnPress7); | ||
} | ||
|
||
public OldImageButton( | ||
int pImageButton0, | ||
int pInt1, | ||
int pInt2, | ||
int pInt3, | ||
int pInt4, | ||
int pInt5, | ||
int pInt6, | ||
ResourceLocation pResourceLocation7, | ||
Button.OnPress pButton$OnPress8 | ||
) { | ||
this(pImageButton0, pInt1, pInt2, pInt3, pInt4, pInt5, pInt6, pResourceLocation7, 256, 256, pButton$OnPress8); | ||
} | ||
|
||
public OldImageButton( | ||
int pImageButton0, | ||
int pInt1, | ||
int pInt2, | ||
int pInt3, | ||
int pInt4, | ||
int pInt5, | ||
int pInt6, | ||
ResourceLocation pResourceLocation7, | ||
int pInt8, | ||
int pInt9, | ||
Button.OnPress pButton$OnPress10 | ||
) { | ||
this(pImageButton0, pInt1, pInt2, pInt3, pInt4, pInt5, pInt6, pResourceLocation7, pInt8, pInt9, pButton$OnPress10, CommonComponents.EMPTY); | ||
} | ||
|
||
public OldImageButton( | ||
int pImageButton0, | ||
int pInt1, | ||
int pInt2, | ||
int pInt3, | ||
int pInt4, | ||
int pInt5, | ||
int pInt6, | ||
ResourceLocation pResourceLocation7, | ||
int pInt8, | ||
int pInt9, | ||
Button.OnPress pButton$OnPress10, | ||
Component pComponent11 | ||
) { | ||
super(pImageButton0, pInt1, pInt2, pInt3, pComponent11, pButton$OnPress10, DEFAULT_NARRATION); | ||
this.textureWidth = pInt8; | ||
this.textureHeight = pInt9; | ||
this.xTexStart = pInt4; | ||
this.yTexStart = pInt5; | ||
this.yDiffTex = pInt6; | ||
this.resourceLocation = pResourceLocation7; | ||
} | ||
|
||
@Override | ||
public void renderWidget(GuiGraphics pImageButton0, int pInt1, int pInt2, float pFloat3) { | ||
this.renderTexture( | ||
pImageButton0, | ||
this.resourceLocation, | ||
this.getX(), | ||
this.getY(), | ||
this.xTexStart, | ||
this.yTexStart, | ||
this.yDiffTex, | ||
this.width, | ||
this.height, | ||
this.textureWidth, | ||
this.textureHeight | ||
); | ||
} | ||
|
||
public void renderTexture( | ||
GuiGraphics pAbstractWidget0, | ||
ResourceLocation pResourceLocation1, | ||
int pInt2, | ||
int pInt3, | ||
int pInt4, | ||
int pInt5, | ||
int pInt6, | ||
int pInt7, | ||
int pInt8, | ||
int pInt9, | ||
int pInt10 | ||
) { | ||
int lvInt12 = pInt5; | ||
if (!this.isActive()) { | ||
lvInt12 = pInt5 + pInt6 * 2; | ||
} else if (this.isHoveredOrFocused()) { | ||
lvInt12 = pInt5 + pInt6; | ||
} | ||
|
||
RenderSystem.enableDepthTest(); | ||
pAbstractWidget0.blit(pResourceLocation1, pInt2, pInt3, (float)pInt4, (float)lvInt12, pInt7, pInt8, pInt9, pInt10); | ||
} | ||
} |
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
Oops, something went wrong.