-
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
7 changed files
with
76 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
minecraft_version=1.15.2 | ||
forge_version=31.0.1 | ||
forge_version=31.1.0 | ||
mappings=20200127-1.15.1 | ||
mod_version=1.6.4 | ||
|
||
|
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,30 +1,25 @@ | ||
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.defaultBlendFunc(); | ||
}, RenderSystem::disableBlend); | ||
protected static final RenderState.LayerState DISABLE_DEPTH = new RenderState.LayerState("disable_depth", GlStateManager::disableDepthTest, GlStateManager::enableDepthTest); | ||
|
||
public PingRenderType(String string, Runnable r, Runnable r1) { | ||
super(string, r, r1); | ||
} | ||
|
||
public static RenderType getPingOverlay() { | ||
RenderType.State renderTypeState = RenderType.State.builder().transparency(OVERLAY_TRANSPARENCY).texture(BLOCK_SHEET).layer(DISABLE_DEPTH).build(true); | ||
RenderType.State renderTypeState = RenderType.State.builder().transparency(TRANSLUCENT_TRANSPARENCY).texture(BLOCK_SHEET).layer(DISABLE_DEPTH).build(true); | ||
return RenderType.get("ping_overlay", DefaultVertexFormats.POSITION_TEX_COLOR, 7, 262144, true, true, renderTypeState); | ||
} | ||
|
||
public static RenderType getPingIcon(ResourceLocation location) { | ||
RenderType.State renderTypeState = RenderType.State.builder().texture(new RenderState.TextureState(location, false, false)).layer(DISABLE_DEPTH).build(true); | ||
RenderType.State renderTypeState = RenderType.State.builder().texture(new RenderState.TextureState(location, false, true)).transparency(TRANSLUCENT_TRANSPARENCY).layer(DISABLE_DEPTH).build(true); | ||
return RenderType.get("ping_icon", DefaultVertexFormats.POSITION_TEX_COLOR, 7, 262144, true, true, renderTypeState); | ||
} | ||
} |
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