mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Better renderBlockForMultiblock signature.
This commit is contained in:
1 parent
9b893e8589
commit
822dd99a62
3 files changed
+7
-5
No files matched your search
@@ -15,6 +15,7 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,6 @@ public interface IMultiblockRenderHook {
|
||||
|
||||
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap();
|
||||
|
||||
public void renderBlockForMultiblock(World world, Block block, int meta, RenderBlocks renderBlocks);
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks);
|
||||
|
||||
}
|
||||
@@ -55,11 +55,11 @@ public final class MultiblockRenderHandler {
|
||||
if(currentMultiblock != null) {
|
||||
Multiblock mb = currentMultiblock.getForEntity(player);
|
||||
for(MultiblockComponent comp : mb.getComponents())
|
||||
renderComponent(player.worldObj, comp, src);
|
||||
renderComponent(player.worldObj, mb, comp, src);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderComponent(World world, MultiblockComponent comp, MovingObjectPosition src) {
|
||||
private void renderComponent(World world, Multiblock mb, MultiblockComponent comp, MovingObjectPosition src) {
|
||||
ChunkCoordinates pos = comp.getRelativePosition();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
@@ -71,7 +71,7 @@ public final class MultiblockRenderHandler {
|
||||
blockRender.useInventoryTint = false;
|
||||
Block block = comp.getBlock();
|
||||
if(IMultiblockRenderHook.renderHooks.containsKey(block))
|
||||
IMultiblockRenderHook.renderHooks.get(block).renderBlockForMultiblock(world, block, comp.getMeta(), blockRender);
|
||||
IMultiblockRenderHook.renderHooks.get(block).renderBlockForMultiblock(world, mb, block, comp.getMeta(), blockRender);
|
||||
else blockRender.renderBlockAsItem(comp.getBlock(), comp.getMeta(), 1F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMultiblockRenderHook {
|
||||
@@ -119,7 +120,7 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMulti
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBlockForMultiblock(World world, Block block, int meta, RenderBlocks renderBlocks) {
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks) {
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
drawCrossedSquares(world, block, block.getIcon(0, meta), 0, 0, 0, -0.5, 0.5, -0.5, 1F, renderBlocks);
|
||||
|
||||
Reference in new issue
Block a user