-
Posts
2 -
Joined
-
Last visited
Converted
-
Gender
Male
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
DatenThielt's Achievements
Tree Puncher (2/8)
0
Reputation
-
DatenThielt changed their profile photo
-
[SOLVED][1.12.2] Rendering code causing hard client crash
DatenThielt replied to DatenThielt's topic in Modder Support
That's what I get for programming after a few beers. Thanks for the reality slap. The try-catch was hiding the original error line, turned out the raytrace could return null over certain blocks. Fixed and thank you! -
Evening all, Trying my first mod here, I've got some code that renders a highlight around air blocks. The code works perfectly, until we come across snow covered blocks, Then it crashes the client with little to no information as to why. Here is the code, and the error below. (the try catch is just for debugging) try { EntityPlayerSP player = Minecraft.getMinecraft().player; World world = player.getEntityWorld(); if (player.getHeldItemMainhand().getItem() == StrapItems.BASIC_STRAP) { ItemBasicStrap myItem = (ItemBasicStrap) player.getHeldItemMainhand().getItem(); RayTraceResult tracer = player.rayTrace(myItem.BlockRange, 1.0F); BlockPos pos = tracer.getBlockPos(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(3.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); Block state = world.getBlockState(pos).getBlock(); double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks(); double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks(); double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks(); RenderGlobal.drawSelectionBoundingBox(state.FULL_BLOCK_AABB.offset(-x, -y, -z).offset(pos).grow(0.002), 1.0F, 1.0F, 1.0F, 0.4F); GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); } } catch (Exception ex) { logger.info("AIR STRAPS AIR STRAPS AIR STRAPS >> {}", ex.getMessage()); } Error Any help would be greatly appreciated!!