Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2] TESR problem (Solved)


mr_crayfish
 Share

Recommended Posts

Hey, I seem to be having a problem with rendering my TESR. It only renders the outline if a mob is in my view. It use to work fine on 1.6.4 but since I've updated to 1.7.2, it has changed.

 

I've also correctly made sure I'm binding it correctly and that it renders past the standard limit.

 

In ClientProxy

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBuildingBlock.class, new OutlineRenderer());

 

In TileEntity

@Override
public double getMaxRenderDistanceSquared()
{
return 16384D;
}

@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox()
{
return INFINITE_EXTENT_AABB;
}

 

width=800 height=449https://dl.dropboxusercontent.com/s/4fm4onyzlnkr3s6/2014-03-17_18.40.08.png[/img]

width=800 height=449https://dl.dropboxusercontent.com/s/zg38ka0fs36q461/2014-03-17_18.40.10.png[/img]

 

If you have any answers to why this might be happening, let me know!

Link to comment
Share on other sites

This is the only other relevant code besides the one I posted above.

package com.mrcrayfish.construction.client.render;

import org.lwjgl.opengl.GL11;

import com.mrcrayfish.construction.tileentity.TileEntityBuildingBlock;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

public class OutlineRenderer extends TileEntitySpecialRenderer
{
    @Override
    public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f)
    {
TileEntityBuildingBlock tebb = (TileEntityBuildingBlock) tileentity;
if (tebb.renderOn)
{
    int metadata = tebb.getWorldObj().getBlockMetadata(tebb.xCoord, tebb.yCoord, tebb.zCoord);

    int width = tebb.width - 2;
    int height = tebb.height - 2;
    int depth = tebb.depth - 2;

    int offsetX = 0;
    int offsetY = tebb.offsetY;
    int offsetZ = 0;

    int colour = tebb.lineColours[tebb.count];

    if (metadata == 2)
    {
	offsetX = -tebb.offsetZ - width - 1;
	offsetZ = tebb.offsetX;
	offsetX -= tebb.bOffsetZ;
	offsetZ += tebb.bOffsetX;
    }
    if (metadata == 5)
    {
	int temp = width;
	width = height;
	height = temp;
	offsetX = -tebb.offsetX - (width + 1);
	offsetZ = -tebb.offsetZ - (height + 1);
	offsetX -= tebb.bOffsetX;
	offsetZ -= tebb.bOffsetZ;
    }
    if (metadata == 3)
    {
	offsetX = tebb.offsetZ;
	offsetZ = -tebb.offsetX - (height + 1);
	offsetX += tebb.bOffsetZ;
	offsetZ -= tebb.bOffsetX;
    }
    if (metadata == 4)
    {
	int temp = width;
	width = height;
	height = temp;
	offsetX = tebb.offsetX;
	offsetZ = tebb.offsetZ;
	offsetX += tebb.bOffsetX;
	offsetZ += tebb.bOffsetZ;
    }

    offsetY += tebb.bOffsetY;

    if (tebb.hasDrawnBlueprint)
    {
	Tessellator tessellator = Tessellator.instance;
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_TEXTURE_2D);

	if (tebb.renderAll) GL11.glDisable(GL11.GL_DEPTH_TEST);

	GL11.glLineWidth(5F);
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 1.5D + height + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 0.5D + 1.0D + offsetX, y + 0.5D + offsetY, z + height + 0.5D + 1.0D + offsetZ);
	tessellator.addVertex(x + width + 0.5D + 1.0D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();

	if (tebb.renderAll) GL11.glEnable(GL11.GL_DEPTH_TEST);

	GL11.glEnable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
}
    }

}

Link to comment
Share on other sites

Hi

 

I'd guess that probably one of the OpenGL flags isn't set right.

 

Perhaps

    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

?

 

I wrote a brief class to print the current OpenGL settings, that might help figure out which flag(s) are different when the mob is in view vs when it isn't in view.

Some more info here plus the link

http://www.minecraftforge.net/forum/index.php/topic,16562.msg84272.html#msg84272

 

-TGG

Link to comment
Share on other sites

Just tried the flag but didn't make any difference.

 

I also used your debugger, outputs were both the same.

 

When looking at mobs

 

GL_VERTEX_ARRAY:false (Vertex array enable)
GL_NORMAL_ARRAY:false (Normal array enable)
GL_COLOR_ARRAY:false (RGBA color array enable)
GL_INDEX_ARRAY:false (Color-index array enable)
GL_TEXTURE_COORD_ARRAY:false (Texture coordinate array enable)
GL_EDGE_FLAG_ARRAY:false (Edge flag array enable)
GL_NORMALIZE:false (Current normal normalization on/off)
GL_FOG:true (True if fog enabled)
GL_LIGHTING:true (True if lighting is enabled)
GL_COLOR_MATERIAL:true (True if color tracking is enabled)
GL_LIGHT0:true (True if light 0 enabled)
GL_LIGHT1:true (True if light 1 enabled)
GL_LIGHT2:false (True if light 2 enabled)
GL_LIGHT3:false (True if light 3 enabled)
GL_LIGHT4:false (True if light 4 enabled)
GL_LIGHT5:false (True if light 5 enabled)
GL_LIGHT6:false (True if light 6 enabled)
GL_LIGHT7:false (True if light 7 enabled)
GL_POINT_SMOOTH:false (Point antialiasing on)
GL_LINE_SMOOTH:false (Line antialiasing on)
GL_LINE_STIPPLE:false (Line stipple enable)
GL_CULL_FACE:true (Polygon culling enabled)
GL_POLYGON_SMOOTH:false (Polygon antialiasing on)
GL_POLYGON_OFFSET_POINT:false (Polygon offset enable for GL_POINT mode rasterization)
GL_POLYGON_OFFSET_LINE:false (Polygon offset enable for GL_LINE mode rasterization)
GL_POLYGON_OFFSET_FILL:false (Polygon offset enable for GL_FILL mode rasterization)
GL_POLYGON_STIPPLE:false (Polygon stipple enable)
GL_TEXTURE_1D:false (True if 1-D texturing enabled )
GL_TEXTURE_2D:true (True if 2-D texturing enabled )
GL_TEXTURE_GEN_S:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_T:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_R:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_Q:false (Texgen enabled (x is S, T, R, or Q))
GL_SCISSOR_TEST:false (Scissoring enabled)
GL_ALPHA_TEST:true (Alpha test enabled)
GL_STENCIL_TEST:false (Stenciling enabled)
GL_DEPTH_TEST:true (Depth buffer enabled)
GL_BLEND:false (Blending enabled)
GL_DITHER:true (Dithering enabled)
GL_INDEX_LOGIC_OP:false (Color index logical operation enabled)
GL_COLOR_LOGIC_OP:false (RGBA color logical operation enabled)
GL_AUTO_NORMAL:false (True if automatic normal generation enabled)

 

 

When not looking at mobs

 

GL_VERTEX_ARRAY:false (Vertex array enable)
GL_NORMAL_ARRAY:false (Normal array enable)
GL_COLOR_ARRAY:false (RGBA color array enable)
GL_INDEX_ARRAY:false (Color-index array enable)
GL_TEXTURE_COORD_ARRAY:false (Texture coordinate array enable)
GL_EDGE_FLAG_ARRAY:false (Edge flag array enable)
GL_NORMALIZE:false (Current normal normalization on/off)
GL_FOG:true (True if fog enabled)
GL_LIGHTING:true (True if lighting is enabled)
GL_COLOR_MATERIAL:true (True if color tracking is enabled)
GL_LIGHT0:true (True if light 0 enabled)
GL_LIGHT1:true (True if light 1 enabled)
GL_LIGHT2:false (True if light 2 enabled)
GL_LIGHT3:false (True if light 3 enabled)
GL_LIGHT4:false (True if light 4 enabled)
GL_LIGHT5:false (True if light 5 enabled)
GL_LIGHT6:false (True if light 6 enabled)
GL_LIGHT7:false (True if light 7 enabled)
GL_POINT_SMOOTH:false (Point antialiasing on)
GL_LINE_SMOOTH:false (Line antialiasing on)
GL_LINE_STIPPLE:false (Line stipple enable)
GL_CULL_FACE:true (Polygon culling enabled)
GL_POLYGON_SMOOTH:false (Polygon antialiasing on)
GL_POLYGON_OFFSET_POINT:false (Polygon offset enable for GL_POINT mode rasterization)
GL_POLYGON_OFFSET_LINE:false (Polygon offset enable for GL_LINE mode rasterization)
GL_POLYGON_OFFSET_FILL:false (Polygon offset enable for GL_FILL mode rasterization)
GL_POLYGON_STIPPLE:false (Polygon stipple enable)
GL_TEXTURE_1D:false (True if 1-D texturing enabled )
GL_TEXTURE_2D:true (True if 2-D texturing enabled )
GL_TEXTURE_GEN_S:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_T:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_R:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_Q:false (Texgen enabled (x is S, T, R, or Q))
GL_SCISSOR_TEST:false (Scissoring enabled)
GL_ALPHA_TEST:true (Alpha test enabled)
GL_STENCIL_TEST:false (Stenciling enabled)
GL_DEPTH_TEST:true (Depth buffer enabled)
GL_BLEND:false (Blending enabled)
GL_DITHER:true (Dithering enabled)
GL_INDEX_LOGIC_OP:false (Color index logical operation enabled)
GL_COLOR_LOGIC_OP:false (RGBA color logical operation enabled)
GL_AUTO_NORMAL:false (True if automatic normal generation enabled)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • MegaMiner is just my playground mod. Here's the entire MegaMinerEvents class. It's just a static event receiver.   package nu.rydin.explodingarrows.common.events; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import nu.rydin.explodingarrows.common.Main; import nu.rydin.explodingarrows.common.enchantments.ModEnchantments; import java.util.LinkedList; @Mod.EventBusSubscriber(modid = Main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class MegaMinerEvents { private static final class BlockToBreak { private final BlockPos pos; private final Player player; public BlockToBreak(final BlockPos pos, final Player player) { this.pos = pos; this.player = player; } } private static final LinkedList<BlockToBreak> queue = new LinkedList<>(); @SubscribeEvent public static void onBreakBlock(final BlockEvent.BreakEvent e) { final LevelAccessor world = e.getWorld(); if (world.isClientSide()) { return; } for (final Tag t : e.getPlayer().getMainHandItem().getEnchantmentTags()) { final CompoundTag ct = (CompoundTag) t; if (ct.getString("id") .equals(ModEnchantments.MEGA_MINER.get().getRegistryName().toString())) { MegaMinerEvents.mineNeighborhood(e.getPos(), e.getPlayer(), e.getState().getBlock()); } } } @SubscribeEvent public static void onTick(final TickEvent.ServerTickEvent e) { if (MegaMinerEvents.queue.isEmpty()) { return; } final BlockToBreak b = MegaMinerEvents.queue.removeFirst(); final Level world = b.player.level; final BlockState bs = world.getBlockState(b.pos); bs.getBlock().playerDestroy(world, b.player, b.pos, bs, null, b.player.getMainHandItem()); world.removeBlock(b.pos, true); // MegaMinerEvents.mineNeighborhood(b.pos, b.player, bs.getBlock()); System.out.println(MegaMinerEvents.queue.size()); } private static void mineNeighborhood( final BlockPos pos, final Player player, final Block blockType) { final float x0 = pos.getX(); final float y0 = pos.getY(); final float z0 = pos.getZ(); for (float z = z0 - 1.0F; z <= z0 + 1; z += 1.0) { for (float y = y0 - 1.0F; y <= y0 + 1; y += 1.0) { for (float x = x0 - 1.0F; x <= x0 + 1; x += 1.0) { final BlockState b = player.getLevel().getBlockState(pos); if (b.is(blockType)) { MegaMinerEvents.queue.addLast(new BlockToBreak(pos, player)); } } } } } }  
    • i am playing modded and NOT ON A SERVER but everytime i join a world my game crashes and the error message is: Exception in server tick loop  
    • Do you know what OneDrive is? It's a cloud storage service. Do not put your Minecraft server there, as the files will be changing frequently and if conflicts occur, the minecraft server executable will probably just corrupt everything.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.