mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Fix road line textures.
This commit is contained in:
1 parent
54b9272732
commit
7ec151f16a
2 files changed
+24
-13
No files matched your search
@@ -1,21 +1,20 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockRoadLine extends BlockCarvable {
|
||||
|
||||
public IIcon aloneIcon[] = new IIcon[4];
|
||||
@@ -26,11 +25,12 @@ public class BlockRoadLine extends BlockCarvable {
|
||||
super(Material.circuits);
|
||||
|
||||
if (Configurations.useRoadLineTool) {
|
||||
this.setHarvestLevel(Configurations.getRoadLineTool,Configurations.roadLineToolLevel);
|
||||
this.setHarvestLevel(Configurations.getRoadLineTool, Configurations.roadLineToolLevel);
|
||||
}
|
||||
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.00390625f, 1.0f);
|
||||
// this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
return null;
|
||||
@@ -70,14 +70,25 @@ public class BlockRoadLine extends BlockCarvable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
String[] texNames = {"white", "yellow", "double-white", "double-yellow"};
|
||||
for (int i = 0; i < 4; i++) {
|
||||
String[] texNames = { "white", "yellow", "double-white", "double-yellow" };
|
||||
aloneIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-center");
|
||||
halfLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-side");
|
||||
fullLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-long");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return aloneIcon[metadata % aloneIcon.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return getIcon(side, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -59,10 +59,10 @@ public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
|
||||
|
||||
boolean N = world.getBlock(x, y, z - 1).equals(block);
|
||||
boolean S = world.getBlock(x, y, z + 1).equals(block);
|
||||
boolean W = world.getBlock(x - 1, y, z).equals(block);
|
||||
boolean E = world.getBlock(x + 1, y, z).equals(block);
|
||||
boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
|
||||
boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
|
||||
boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
|
||||
boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;
|
||||
|
||||
if (!N && !S && !W && !E) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
Reference in new issue
Block a user