mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 11:15:07 +00:00
- forge microblocks of neonite, antiblock and glotek are now emissive when using shaders
This commit is contained in:
1 parent
df216f68b4
commit
2150548111
4 files changed
+87
-6
No files matched your search
@@ -19,10 +19,13 @@ import com.cricketcraft.chisel.api.ChiselAPIProps;
|
|||||||
import com.cricketcraft.chisel.api.FMPIMC;
|
import com.cricketcraft.chisel.api.FMPIMC;
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
|
import codechicken.microblock.MicroMaterialRegistry;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.block.BlockCarvableGlowie;
|
||||||
|
import team.chisel.client.render.FullBrightMicroMaterial;
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public class CarvableHelper {
|
public class CarvableHelper {
|
||||||
@@ -187,11 +190,21 @@ public class CarvableHelper {
|
|||||||
Block block = info.getVariation()
|
Block block = info.getVariation()
|
||||||
.getBlock();
|
.getBlock();
|
||||||
|
|
||||||
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
if (block instanceof BlockCarvableGlowie) {
|
||||||
FMPIMC.registerFMP(
|
int meta = info.getVariation()
|
||||||
block,
|
.getBlockMeta();
|
||||||
info.getVariation()
|
|
||||||
.getBlockMeta());
|
MicroMaterialRegistry.registerMaterial(
|
||||||
|
new FullBrightMicroMaterial(block, meta),
|
||||||
|
block.getUnlocalizedName() + ((meta > 0) ? ("_" + meta) : ""));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
||||||
|
FMPIMC.registerFMP(
|
||||||
|
block,
|
||||||
|
info.getVariation()
|
||||||
|
.getBlockMeta());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forbidChiseling) return;
|
if (forbidChiseling) return;
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public enum Features {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void addBlocks() {
|
void addBlocks() {
|
||||||
BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableAntiBlock()
|
BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableGlowie(Material.rock)
|
||||||
.setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
.setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
||||||
|
|
||||||
if (!Configurations.allowChiselCrossColors) {
|
if (!Configurations.allowChiselCrossColors) {
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package team.chisel.client.render;
|
||||||
|
|
||||||
|
import codechicken.lib.render.CCRenderState;
|
||||||
|
|
||||||
|
public class FullBrightLighting implements CCRenderState.IVertexOperation {
|
||||||
|
|
||||||
|
public static FullBrightLighting instance = new FullBrightLighting();
|
||||||
|
public int id;
|
||||||
|
|
||||||
|
public boolean load() {
|
||||||
|
if (!CCRenderState.computeLighting) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CCRenderState.pipeline.addDependency(CCRenderState.colourAttrib);
|
||||||
|
CCRenderState.pipeline.addDependency(CCRenderState.lightCoordAttrib);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void operate() {
|
||||||
|
CCRenderState.setBrightness(FULL_BRIGHT_BLOCK_BRIGHTNESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int operationID() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
id = CCRenderState.registerOperation();
|
||||||
|
}
|
||||||
|
|
||||||
|
// magic number from 'RenderBlocksCTMFullbright'
|
||||||
|
// this is the brightness of the neonite, anti, glotek blocks
|
||||||
|
// so we use it for custom microblock lighting
|
||||||
|
private final static int FULL_BRIGHT_BLOCK_BRIGHTNESS = 0xF000F0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package team.chisel.client.render;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
import codechicken.lib.render.CCRenderState;
|
||||||
|
import codechicken.lib.render.ColourMultiplier;
|
||||||
|
import codechicken.lib.vec.Cuboid6;
|
||||||
|
import codechicken.lib.vec.Vector3;
|
||||||
|
import codechicken.microblock.BlockMicroMaterial;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class FullBrightMicroMaterial extends BlockMicroMaterial {
|
||||||
|
|
||||||
|
public FullBrightMicroMaterial(final Block block, final int meta) {
|
||||||
|
super(block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void renderMicroFace(final Vector3 pos, final int pass, final Cuboid6 bounds) {
|
||||||
|
CCRenderState.pipeline.builder()
|
||||||
|
.add((CCRenderState.IVertexOperation) pos.translation())
|
||||||
|
.add((CCRenderState.IVertexOperation) this.icont())
|
||||||
|
.add((CCRenderState.IVertexOperation) ColourMultiplier.instance(FULL_BRIGHT_COLOR_MULTIPLIER))
|
||||||
|
.add((CCRenderState.IVertexOperation) FullBrightLighting.instance)
|
||||||
|
.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
// magic number from 'RenderBlocksCTMFullbright'
|
||||||
|
// this is what makes the neonite, anti, glotek blocks burn bright as my ass does
|
||||||
|
// so we use it for custom microblock render
|
||||||
|
private final static int FULL_BRIGHT_COLOR_MULTIPLIER = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user