2011-07-15 23:13:09 +00:00
|
|
|
/**
|
2012-02-25 06:07:58 +00:00
|
|
|
* This software is provided under the terms of the Minecraft Forge Public
|
2011-07-15 23:13:09 +00:00
|
|
|
* License v1.0.
|
|
|
|
*/
|
|
|
|
|
2012-08-06 22:07:53 +00:00
|
|
|
package net.minecraftforge.client;
|
2011-07-15 23:04:10 +00:00
|
|
|
|
2013-05-16 00:29:47 +00:00
|
|
|
import java.util.BitSet;
|
2014-12-26 05:39:12 +00:00
|
|
|
import net.minecraft.util.EnumWorldBlockLayer;
|
2011-07-15 23:04:10 +00:00
|
|
|
|
2012-02-25 06:07:58 +00:00
|
|
|
public class MinecraftForgeClient
|
|
|
|
{
|
2013-03-07 03:26:29 +00:00
|
|
|
public static int getRenderPass()
|
2013-03-07 03:18:26 +00:00
|
|
|
{
|
|
|
|
return ForgeHooksClient.renderPass;
|
|
|
|
}
|
2013-05-09 00:13:19 +00:00
|
|
|
|
2014-12-26 05:39:12 +00:00
|
|
|
public static EnumWorldBlockLayer getRenderLayer()
|
|
|
|
{
|
2015-02-08 23:46:01 +00:00
|
|
|
return ForgeHooksClient.renderLayer.get();
|
2014-12-26 05:39:12 +00:00
|
|
|
}
|
|
|
|
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
private static BitSet stencilBits = new BitSet(8);
|
2013-05-16 00:29:47 +00:00
|
|
|
static
|
|
|
|
{
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
stencilBits.set(0,8);
|
2013-05-16 00:29:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reserve a stencil bit for use in rendering
|
|
|
|
*
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
* Note: you must check the Framebuffer you are working with to
|
|
|
|
* determine if stencil bits are enabled on it before use.
|
|
|
|
*
|
2013-05-16 00:29:47 +00:00
|
|
|
* @return A bit or -1 if no further stencil bits are available
|
|
|
|
*/
|
|
|
|
public static int reserveStencilBit()
|
|
|
|
{
|
|
|
|
int bit = stencilBits.nextSetBit(0);
|
|
|
|
if (bit >= 0)
|
|
|
|
{
|
|
|
|
stencilBits.clear(bit);
|
|
|
|
}
|
|
|
|
return bit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Release the stencil bit for other use
|
|
|
|
*
|
|
|
|
* @param bit The bit from {@link #reserveStencilBit()}
|
|
|
|
*/
|
|
|
|
public static void releaseStencilBit(int bit)
|
|
|
|
{
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
if (bit >= 0 && bit < stencilBits.length())
|
2013-05-16 00:29:47 +00:00
|
|
|
{
|
|
|
|
stencilBits.set(bit);
|
|
|
|
}
|
|
|
|
}
|
2011-07-15 23:04:10 +00:00
|
|
|
}
|