Fixed the log textures

This commit is contained in:
Amnet 2013-05-26 01:14:12 +02:00
parent 1fb3a79fbc
commit 7ab6536a53

View file

@ -2,8 +2,6 @@ package biomesoplenty.blocks;
import java.util.List; import java.util.List;
import biomesoplenty.BiomesOPlenty;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
@ -11,8 +9,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side; import biomesoplenty.BiomesOPlenty;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPLog extends Block public class BlockBOPLog extends Block
{ {
@ -46,7 +43,7 @@ public class BlockBOPLog extends Block
for (int i = 0; i < types.length; ++i) for (int i = 0; i < types.length; ++i)
{ {
if (1 != 11) if (i != 11)
{ {
textures[i] = iconRegister.registerIcon("BiomesOPlenty:log_"+types[i]+"_side"); textures[i] = iconRegister.registerIcon("BiomesOPlenty:log_"+types[i]+"_side");
logHearts[i] = iconRegister.registerIcon("BiomesOPlenty:log_"+types[i]+"_heart"); logHearts[i] = iconRegister.registerIcon("BiomesOPlenty:log_"+types[i]+"_heart");
@ -61,20 +58,10 @@ public class BlockBOPLog extends Block
public Icon getIcon(int side, int meta) public Icon getIcon(int side, int meta)
{ {
int pos = meta & 12; int pos = meta & 12;
if (category != LogCategory.CAT4) if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3))
{ return logHearts[(getTypeFromMeta(meta) + this.category.ordinal() * 4)];
if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3))
return logHearts[(getTypeFromMeta(meta) + this.category.ordinal() * 4)];
else
return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 4)];
}
else else
{ return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 4)];
if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3))
return logHearts[(getTypeFromMeta(meta) + this.category.ordinal() * 3)];
else
return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 3)];
}
} }
@Override @Override
@ -168,14 +155,7 @@ public class BlockBOPLog extends Block
public String getWoodType(int meta) public String getWoodType(int meta)
{ {
if (category != LogCategory.CAT4) return types[getTypeFromMeta(meta) + category.ordinal() * 4];
{
return types[getTypeFromMeta(meta) + category.ordinal() * 4];
}
else
{
return types[getTypeFromMeta(meta) + category.ordinal() * 3];
}
} }
private static int getTypeFromMeta(int meta) private static int getTypeFromMeta(int meta)