Update crosshair
This commit is contained in:
parent
cefa4381f2
commit
cce95e7f1a
@ -1,6 +1,7 @@
|
|||||||
package ru.magistu.siegemachines.client.gui.machine.crosshair;
|
package ru.magistu.siegemachines.client.gui.machine.crosshair;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import ru.magistu.siegemachines.SiegeMachines;
|
import ru.magistu.siegemachines.SiegeMachines;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@ -19,7 +20,7 @@ public abstract class Crosshair extends HudElement
|
|||||||
super(width, height);
|
super(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void render(PoseStack matrixstack, float partialticks) {}
|
public final void render(GuiGraphics matrixstack, float partialticks) {}
|
||||||
|
|
||||||
public abstract void render(PoseStack matrixstack, float ticks, Minecraft mc, Player player);
|
public abstract void render(GuiGraphics matrixstack, float ticks, Minecraft mc, Player player);
|
||||||
}
|
}
|
@ -68,6 +68,4 @@ public abstract class HudElement
|
|||||||
{
|
{
|
||||||
return this.height;
|
return this.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void render(PoseStack paramMatrixStack, float paramFloat);
|
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package ru.magistu.siegemachines.client.gui.machine.crosshair;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import ru.magistu.siegemachines.entity.machine.Machine;
|
import ru.magistu.siegemachines.entity.machine.Machine;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
@ -24,7 +25,7 @@ public class ReloadingCrosshair extends Crosshair
|
|||||||
this.y = Minecraft.getInstance().getWindow().getGuiScaledHeight() / 2;
|
this.y = Minecraft.getInstance().getWindow().getGuiScaledHeight() / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(PoseStack matrixstack, float ticks, Minecraft mc, Player player)
|
public void render(GuiGraphics matrixstack, float ticks, Minecraft mc, Player player)
|
||||||
{
|
{
|
||||||
RenderSystem.assertOnRenderThread();
|
RenderSystem.assertOnRenderThread();
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ public class ReloadingCrosshair extends Crosshair
|
|||||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||||
RenderSystem.setShaderTexture(0, CROSSHAIR_TEXTURES);
|
RenderSystem.setShaderTexture(0, CROSSHAIR_TEXTURES);
|
||||||
|
|
||||||
mc.gui.blit(matrixstack, originx, originy, imagex, imagey, width, height);
|
matrixstack.blit(CROSSHAIR_TEXTURES, originx, originy, imagex, imagey, width, height);
|
||||||
|
|
||||||
RenderSystem.backupProjectionMatrix();
|
RenderSystem.backupProjectionMatrix();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user