// Path: src/main/java/two/davincing/DaVincing.java
// @Mod(modid = DaVincing.MOD_ID, name = DaVincing.MOD_NAME, version = DaVincing.MOD_VERSION)
// public class DaVincing {
// 
//   /* Global logger that uses string format type logging */
//   public static final Logger log = LogManager.getLogger(DaVincing.class.getSimpleName(), new StringFormatterMessageFactory());
//   /* Task scheduler for background task. Will run at lowest thread priority to not interfere with FPS/ticks */
//   public static final ScheduledExecutorService backgroundTasks = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new PriorityThreadFactory(DaVincing.class.getSimpleName() + " Worker", Thread.MIN_PRIORITY, true));
//   public static final ConcurrentLinkedQueue<Runnable> glTasks = new ConcurrentLinkedQueue<Runnable>();
//   
//   public static final String MOD_NAME = "DaVincing";
//   public static final String MOD_ID = "davincing";
//   public static final String MOD_VERSION = "1710.1.8"; // Make sure to keep this version in sync with the build.gradle file!
// 
//   @Mod.Instance(MOD_ID)
//   public static DaVincing instance; // this will point to the actual instance of this class once running
// 
//   @SidedProxy(clientSide = "two.davincing.ProxyClient", serverSide = "two.davincing.ProxyServer")
//   public static ProxyBase proxy; // will load the appropriate proxy class depending whether this is running on a client or on a server
// 
//   public static final Config config = new Config();
//   public static final CreativeTabs tabDaVincing = new DaVincingCreativeTab();
//   public static final SimpleNetworkWrapper network = NetworkRegistry.INSTANCE.newSimpleChannel("minepainter");
// 
//   @Mod.EventHandler
//   public void preInit(FMLPreInitializationEvent event) {
//     config.initialize(event.getSuggestedConfigurationFile());
//     proxy.onPreInit();
//   }
// 
//   @Mod.EventHandler
//   public void init(FMLInitializationEvent e) {
//     config.load();
//     proxy.onInit();
// 
//     Crafting.instance.registerRecipes();
// 
//     network.registerMessage(SculptureOperationMessage.SculptureOperationHandler.class, SculptureOperationMessage.class, 0, Side.SERVER);
//     network.registerMessage(PaintingOperationHandler.class, PaintingOperationMessage.class, 1, Side.SERVER);
//     config.save();
//   }
// 
//   @Mod.EventHandler
//   public void postInit(final FMLPostInitializationEvent event) {
//     proxy.onPostInit();
//   }
// 
//   @Mod.EventHandler
//   public void serverLoad(final FMLServerStartingEvent event) {
//     event.registerServerCommand(new CommandImportPainting());
//   }
// 
//   @Mod.EventHandler
//   public void serverStopped(final FMLServerStoppedEvent event) {
//   }
// }


import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import two.davincing.DaVincing;
        int light = lightY * 65536 + lightX;

        se.getRender().initFromSculptureAndLight(se.sculpture(), light);
      } else {
        se.updateRender();
      }

      RenderHelper.disableStandardItemLighting();
      GL11.glPushMatrix();
      GL11.glTranslated(xd, yd, zd);

      int displayList = se.getRender().glDisplayList[0];
      if (displayList > 0) {
        GL11.glCallList(displayList);
      }

      displayList = se.getRender().glDisplayList[1];
      if (displayList > 0) {
        GL11.glEnable(GL11.GL_BLEND);
        OpenGlHelper.glBlendFunc(770, 771, 1, 0);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
        GL11.glCallList(displayList);
        GL11.glDisable(GL11.GL_BLEND);
      }

      GL11.glPopMatrix();

//        GL11.glEnable(GL11.GL_ALPHA_TEST);
      RenderHelper.enableStandardItemLighting();
    } else {
// Path: src/main/java/two/davincing/DaVincing.java
// @Mod(modid = DaVincing.MOD_ID, name = DaVincing.MOD_NAME, version = DaVincing.MOD_VERSION)
// public class DaVincing {
// 
//   /* Global logger that uses string format type logging */
//   public static final Logger log = LogManager.getLogger(DaVincing.class.getSimpleName(), new StringFormatterMessageFactory());
//   /* Task scheduler for background task. Will run at lowest thread priority to not interfere with FPS/ticks */
//   public static final ScheduledExecutorService backgroundTasks = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new PriorityThreadFactory(DaVincing.class.getSimpleName() + " Worker", Thread.MIN_PRIORITY, true));
//   public static final ConcurrentLinkedQueue<Runnable> glTasks = new ConcurrentLinkedQueue<Runnable>();
//   
//   public static final String MOD_NAME = "DaVincing";
//   public static final String MOD_ID = "davincing";
//   public static final String MOD_VERSION = "1710.1.8"; // Make sure to keep this version in sync with the build.gradle file!
// 
//   @Mod.Instance(MOD_ID)
//   public static DaVincing instance; // this will point to the actual instance of this class once running
// 
//   @SidedProxy(clientSide = "two.davincing.ProxyClient", serverSide = "two.davincing.ProxyServer")
//   public static ProxyBase proxy; // will load the appropriate proxy class depending whether this is running on a client or on a server
// 
//   public static final Config config = new Config();
//   public static final CreativeTabs tabDaVincing = new DaVincingCreativeTab();
//   public static final SimpleNetworkWrapper network = NetworkRegistry.INSTANCE.newSimpleChannel("minepainter");
// 
//   @Mod.EventHandler
//   public void preInit(FMLPreInitializationEvent event) {
//     config.initialize(event.getSuggestedConfigurationFile());
//     proxy.onPreInit();
//   }
// 
//   @Mod.EventHandler
//   public void init(FMLInitializationEvent e) {
//     config.load();
//     proxy.onInit();
// 
//     Crafting.instance.registerRecipes();
// 
//     network.registerMessage(SculptureOperationMessage.SculptureOperationHandler.class, SculptureOperationMessage.class, 0, Side.SERVER);
//     network.registerMessage(PaintingOperationHandler.class, PaintingOperationMessage.class, 1, Side.SERVER);
//     config.save();
//   }
// 
//   @Mod.EventHandler
//   public void postInit(final FMLPostInitializationEvent event) {
//     proxy.onPostInit();
//   }
// 
//   @Mod.EventHandler
//   public void serverLoad(final FMLServerStartingEvent event) {
//     event.registerServerCommand(new CommandImportPainting());
//   }
// 
//   @Mod.EventHandler
//   public void serverStopped(final FMLServerStoppedEvent event) {
//   }
// }


// Path: src/main/java/two/davincing/sculpture/SculptureEntityRenderer.java
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import two.davincing.DaVincing;

        int light = lightY * 65536 + lightX;

        se.getRender().initFromSculptureAndLight(se.sculpture(), light);
      } else {
        se.updateRender();
      }

      RenderHelper.disableStandardItemLighting();
      GL11.glPushMatrix();
      GL11.glTranslated(xd, yd, zd);

      int displayList = se.getRender().glDisplayList[0];
      if (displayList > 0) {
        GL11.glCallList(displayList);
      }

      displayList = se.getRender().glDisplayList[1];
      if (displayList > 0) {
        GL11.glEnable(GL11.GL_BLEND);
        OpenGlHelper.glBlendFunc(770, 771, 1, 0);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
        GL11.glCallList(displayList);
        GL11.glDisable(GL11.GL_BLEND);
      }

      GL11.glPopMatrix();

//        GL11.glEnable(GL11.GL_ALPHA_TEST);
      RenderHelper.enableStandardItemLighting();
    } else {
      DaVincing.log.error("[SculptureEntityRenderer.renderTileEntityAt]: expected SculptureEntity at %f, %f, %f, but got %s", xd, yd, zd, (tileEntity == null ? "null" : tileEntity.getClass().getName()));