HolesModule: Fixes render bugs, Updated version to 3.1.5
This commit is contained in:
parent
cd60dea84a
commit
59773448ce
|
@ -18,7 +18,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
|
|
||||||
apply plugin: "com.github.johnrengelman.shadow"
|
apply plugin: "com.github.johnrengelman.shadow"
|
||||||
|
|
||||||
version = "3.1.4"
|
version = "3.1.5"
|
||||||
group = "me.rigamortis"
|
group = "me.rigamortis"
|
||||||
archivesBaseName = "seppuku"
|
archivesBaseName = "seppuku"
|
||||||
def buildmode = "IDE"
|
def buildmode = "IDE"
|
||||||
|
|
|
@ -452,12 +452,14 @@ public final class RenderUtil {
|
||||||
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
GlStateManager.disableTexture2D();
|
GlStateManager.disableTexture2D();
|
||||||
GlStateManager.disableDepth();
|
GlStateManager.disableDepth();
|
||||||
|
//GlStateManager.disableLighting();
|
||||||
GL11.glEnable(GL_LINE_SMOOTH);
|
GL11.glEnable(GL_LINE_SMOOTH);
|
||||||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void end3D() {
|
public static void end3D() {
|
||||||
GL11.glDisable(GL_LINE_SMOOTH);
|
GL11.glDisable(GL_LINE_SMOOTH);
|
||||||
|
//GlStateManager.enableLighting();
|
||||||
GlStateManager.enableDepth();
|
GlStateManager.enableDepth();
|
||||||
GlStateManager.enableTexture2D();
|
GlStateManager.enableTexture2D();
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package me.rigamortis.seppuku.impl.module.render;
|
package me.rigamortis.seppuku.impl.module.render;
|
||||||
|
|
||||||
|
import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
|
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
|
||||||
import me.rigamortis.seppuku.api.event.render.EventRender3D;
|
import me.rigamortis.seppuku.api.event.render.EventRender3D;
|
||||||
import me.rigamortis.seppuku.api.module.Module;
|
import me.rigamortis.seppuku.api.module.Module;
|
||||||
import me.rigamortis.seppuku.api.util.MathUtil;
|
import me.rigamortis.seppuku.api.util.MathUtil;
|
||||||
|
import me.rigamortis.seppuku.api.util.RenderUtil;
|
||||||
import me.rigamortis.seppuku.api.value.Value;
|
import me.rigamortis.seppuku.api.value.Value;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -73,7 +75,10 @@ public final class HolesModule extends Module {
|
||||||
@Listener
|
@Listener
|
||||||
public void onRender(EventRender3D event) {
|
public void onRender(EventRender3D event) {
|
||||||
final Minecraft mc = Minecraft.getMinecraft();
|
final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
if (mc.getRenderViewEntity() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RenderUtil.begin3D();
|
||||||
for (Hole hole : this.holes) {
|
for (Hole hole : this.holes) {
|
||||||
final AxisAlignedBB bb = new AxisAlignedBB(
|
final AxisAlignedBB bb = new AxisAlignedBB(
|
||||||
hole.getX() - mc.getRenderManager().viewerPosX,
|
hole.getX() - mc.getRenderManager().viewerPosX,
|
||||||
|
@ -92,29 +97,15 @@ public final class HolesModule extends Module {
|
||||||
bb.maxY + mc.getRenderManager().viewerPosY,
|
bb.maxY + mc.getRenderManager().viewerPosY,
|
||||||
bb.maxZ + mc.getRenderManager().viewerPosZ))) {
|
bb.maxZ + mc.getRenderManager().viewerPosZ))) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.enableBlend();
|
|
||||||
GlStateManager.disableDepth();
|
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1);
|
|
||||||
GlStateManager.disableTexture2D();
|
|
||||||
GlStateManager.depthMask(false);
|
|
||||||
glEnable(GL_LINE_SMOOTH);
|
|
||||||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
|
||||||
glLineWidth(1.5f);
|
glLineWidth(1.5f);
|
||||||
|
|
||||||
final double dist = mc.player.getDistance(hole.getX() + 0.5f, hole.getY() + 0.5f, hole.getZ() + 0.5f) * 0.75f;
|
final double dist = mc.player.getDistance(hole.getX() + 0.5f, hole.getY() + 0.5f, hole.getZ() + 0.5f) * 0.75f;
|
||||||
|
|
||||||
float alpha = MathUtil.clamp((float) (dist * 255.0f / (this.radius.getValue()) / 255.0f), 0.0f, 0.3f);
|
float alpha = MathUtil.clamp((float) (dist * 255.0f / (this.radius.getValue()) / 255.0f), 0.0f, 0.3f);
|
||||||
|
|
||||||
RenderGlobal.renderFilledBox(bb, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
|
RenderGlobal.renderFilledBox(bb, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
|
||||||
RenderGlobal.drawBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
|
RenderGlobal.drawBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
|
||||||
glDisable(GL_LINE_SMOOTH);
|
|
||||||
GlStateManager.depthMask(true);
|
|
||||||
GlStateManager.enableDepth();
|
|
||||||
GlStateManager.enableTexture2D();
|
|
||||||
GlStateManager.disableBlend();
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RenderUtil.end3D();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isBlockValid(IBlockState blockState, BlockPos blockPos) {
|
private boolean isBlockValid(IBlockState blockState, BlockPos blockPos) {
|
||||||
|
|
Loading…
Reference in New Issue