mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Replace the old connected glass renderer with one adapted from Chisel.
I've made modifications to the original system to allow multi-meta CTM, such as between Dynamic Tanks and Dynamic Valves. This also allows texturing with effectively 5 textures, as opposed to the 47 needed previously
This commit is contained in:
1 parent
1ba5665e07
commit
5ae5036e62
66 files changed
+1083
-166
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.render.block.TextureSubmap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CTMData
|
||||
{
|
||||
public IIcon icon;
|
||||
|
||||
public TextureSubmap submap;
|
||||
|
||||
public TextureSubmap submapSmall;
|
||||
|
||||
public String texture;
|
||||
|
||||
public List<Integer> acceptableMetas;
|
||||
|
||||
public CTMData(String textureName, List<Integer> connectableMeta)
|
||||
{
|
||||
texture = textureName;
|
||||
acceptableMetas = connectableMeta;
|
||||
}
|
||||
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
icon = register.registerIcon("mekanism:" + texture);
|
||||
submap = new TextureSubmap(register.registerIcon("mekanism:" + texture + "-ctm"), 4, 4);
|
||||
submapSmall = new TextureSubmap(icon, 2, 2);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldRenderSide(IBlockAccess world, int x, int y, int z, int side, Block block)
|
||||
{
|
||||
Coord4D obj = new Coord4D(x, y, z);
|
||||
return !(obj.getBlock(world).equals(block) && acceptableMetas.contains(obj.getMetadata(world)));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user