-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
141 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
package dmillerw.ping.client; | ||
|
||
import com.mojang.blaze3d.platform.GlStateManager; | ||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import net.minecraft.client.renderer.RenderState; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class PingRenderType extends RenderState { | ||
protected static final RenderState.TransparencyState OVERLAY_TRANSPARENCY = new RenderState.TransparencyState("overlay_transparency", () -> { | ||
RenderSystem.enableBlend(); | ||
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); | ||
RenderSystem.disableDepthTest(); | ||
}, () -> { | ||
RenderSystem.enableDepthTest(); | ||
RenderSystem.disableBlend(); | ||
RenderSystem.defaultBlendFunc(); | ||
}); | ||
|
||
public PingRenderType(String string, Runnable r, Runnable r1) { | ||
super(string, r, r1); | ||
} | ||
|
||
public static RenderType getPingOverlay(ResourceLocation location) { | ||
RenderType.State renderTypeState = RenderType.State.func_228694_a_().func_228724_a_(new RenderState.TextureState(location, false, false)).func_228726_a_(field_228514_f_).func_228716_a_(field_228533_y_).func_228713_a_(field_228517_i_).func_228719_a_(field_228529_u_).func_228722_a_(field_228530_v_).func_228728_a_(true); | ||
return RenderType.func_228633_a_("ping_overlay_translucent", DefaultVertexFormats.POSITION_COLOR, 7, 256, true, true, renderTypeState); | ||
public static RenderType getPingOverlay() { | ||
RenderType.State renderTypeState = RenderType.State.builder().transparency(OVERLAY_TRANSPARENCY) | ||
//.func_228716_a_(field_228533_y_) | ||
//.func_228713_a_(field_228517_i_) | ||
//.func_228719_a_(field_228529_u_) | ||
//.func_228722_a_(field_228530_v_) | ||
.build(true); | ||
return RenderType.get("ping_overlay_transparent", DefaultVertexFormats.BLOCK, 7, 256, true, true, renderTypeState); | ||
} | ||
} |
Oops, something went wrong.