Skip to content

Commit

Permalink
Fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavid04 committed Apr 15, 2024
1 parent 6b2a369 commit f9778f8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/main/java/gdavid/phi/entity/render/MarkerRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat.Mode;
import gdavid.phi.Phi;
import gdavid.phi.entity.MarkerEntity;
import java.util.UUID;
Expand All @@ -13,7 +12,6 @@
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.network.syncher.SynchedEntityData;
Expand All @@ -22,7 +20,6 @@
import com.mojang.math.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;

import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS;

Expand All @@ -35,6 +32,7 @@ public class MarkerRenderer extends EntityRenderer<MarkerEntity> {
.setTextureState(new RenderStateShard.TextureStateShard(new ResourceLocation(Phi.modId, "textures/entity/marker.png"),
false, false))
.setCullState(new RenderStateShard.CullStateShard(false)).setDepthTestState(new RenderStateShard.DepthTestStateShard("always", 519))
.setShaderState(RenderStateShard.POSITION_COLOR_TEX_SHADER)
.setTransparencyState(new RenderStateShard.TransparencyStateShard("lightning_transparency", () -> {
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat.Mode;
import gdavid.phi.Phi;
import gdavid.phi.entity.PsiProjectileEntity;
import gdavid.phi.util.RenderHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.world.item.ItemStack;
Expand All @@ -22,7 +20,6 @@
import com.mojang.math.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;
import vazkii.psi.api.PsiAPI;

import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS;
Expand All @@ -36,6 +33,7 @@ public class PsiProjectileRenderer extends EntityRenderer<PsiProjectileEntity> {
.setTextureState(new RenderStateShard.TextureStateShard(
new ResourceLocation(PsiAPI.MOD_ID, "textures/particle/wisp.png"), false, false))
.setCullState(new RenderStateShard.CullStateShard(false))
.setShaderState(RenderStateShard.POSITION_COLOR_TEX_SHADER)
.setTransparencyState(new RenderStateShard.TransparencyStateShard("lightning_transparency", () -> {
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat.Mode;
import gdavid.phi.Phi;
import gdavid.phi.entity.PsionWaveEntity;
import gdavid.phi.util.RenderHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.world.item.ItemStack;
Expand All @@ -23,7 +21,6 @@
import com.mojang.math.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;
import vazkii.psi.api.PsiAPI;

import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS;
Expand All @@ -37,6 +34,7 @@ public class PsionWaveRenderer extends EntityRenderer<PsionWaveEntity> {
.setTextureState(new RenderStateShard.TextureStateShard(
new ResourceLocation(PsiAPI.MOD_ID, "textures/particle/wisp.png"), false, false))
.setCullState(new RenderStateShard.CullStateShard(false))
.setShaderState(RenderStateShard.POSITION_COLOR_TEX_SHADER)
.setTransparencyState(new RenderStateShard.TransparencyStateShard("lightning_transparency", () -> {
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/gdavid/phi/entity/render/SpiritRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat.Mode;
import gdavid.phi.Phi;
import gdavid.phi.entity.SpiritEntity;
import java.util.UUID;
Expand All @@ -13,7 +12,6 @@
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.network.syncher.SynchedEntityData;
Expand All @@ -22,7 +20,6 @@
import com.mojang.math.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;

import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS;

Expand All @@ -35,6 +32,7 @@ public class SpiritRenderer extends EntityRenderer<SpiritEntity> {
.setTextureState(new RenderStateShard.TextureStateShard(new ResourceLocation(Phi.modId, "textures/entity/spirit.png"),
false, false))
.setCullState(new RenderStateShard.CullStateShard(false))
.setShaderState(RenderStateShard.POSITION_COLOR_TEX_SHADER)
.setTransparencyState(new RenderStateShard.TransparencyStateShard("translucent_transparency", () -> {
RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
Expand All @@ -51,7 +49,6 @@ public SpiritRenderer(Context context) {
}

@Override
@SuppressWarnings("resource")
public void render(SpiritEntity entity, float entityYaw, float partialTicks, PoseStack ms,
MultiBufferSource buffers, int light) {
SynchedEntityData dm = entity.getEntityData();
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
public net.minecraft.server.network.ServerGamePacketListenerImpl f_9736_ # clientIsFloating
public net.minecraft.world.entity.Entity f_19816_ # eyeHeight
public net.minecraft.client.renderer.RenderStateShard f_173101_ # POSITION_COLOR_TEX_SHADER

0 comments on commit f9778f8

Please sign in to comment.