Fix halo crashing, also tweak visuals slightly. Closes #314

This commit is contained in:
Vincent Lee committed 2016-06-01 20:39:49 -05:00
1 parent d2aa4e0ebc
commit 95bd4689d6
2 files changed
+8 -11

No files matched your search

@@ -142,9 +142,13 @@ public final class HUDHandler {
}
if(main != null && main.getItem() instanceof ItemCraftingHalo) {
profiler.startSection("craftingHalo");
profiler.startSection("craftingHalo_main");
ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, main);
profiler.endSection();
} else if(offhand != null && offhand.getItem() instanceof ItemCraftingHalo) {
profiler.startSection("craftingHalo_off");
ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, offhand);
profiler.endSection();
}
if(main != null && main.getItem() instanceof ItemSextant) {
@@ -460,20 +460,13 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
ItemStack slotStack = getItemForSlot(stack, seg);
if(slotStack != null) {
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
float scale = seg == 0 ? 0.75F : 0.6F;
float scale = seg == 0 ? 0.9F : 0.8F;
GlStateManager.scale(scale, scale, scale);
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(seg == 0 ? 0.5F : 0F, seg == 0 ? -0.1F : 0.6F, 0F);
if(slotStack.getItem() instanceof ItemBlock) {
GlStateManager.translate(0, -0.5, 0.5F);
IBlockState state = ((ItemBlock) slotStack.getItem()).block.getStateFromMeta(slotStack.getItem().getMetadata(slotStack.getMetadata()));
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(state, 1.0F);
} else {
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
Minecraft.getMinecraft().getRenderItem().renderItem(slotStack, ItemCameraTransforms.TransformType.GUI);
}
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
Minecraft.getMinecraft().getRenderItem().renderItem(slotStack, ItemCameraTransforms.TransformType.GUI);
}
GlStateManager.popMatrix();