mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added double and petite flower alternate textures by Futureazoo.
This commit is contained in:
1 parent
680c547f1e
commit
a8f63d376c
36 files changed
+15
-4
No files matched your search
@@ -18,10 +18,13 @@ import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public final class IconHelper {
|
||||
|
||||
|
||||
public static IIcon forName(IIconRegister ir, String name) {
|
||||
return ir.registerIcon(LibResources.PREFIX_MOD + name);
|
||||
}
|
||||
|
||||
public static IIcon forName(IIconRegister ir, String name, String dir) {
|
||||
return ir.registerIcon(LibResources.PREFIX_MOD + dir + "/" + name);
|
||||
}
|
||||
|
||||
public static IIcon forBlock(IIconRegister ir, Block block) {
|
||||
return forName(ir, block.getUnlocalizedName().replaceAll("tile\\.", ""));
|
||||
@@ -40,7 +43,7 @@ public final class IconHelper {
|
||||
}
|
||||
|
||||
public static IIcon forBlock(IIconRegister ir, Block block, String s, String dir) {
|
||||
return forName(ir, dir + "/" + block.getUnlocalizedName().replaceAll("tile\\.", "") + s);
|
||||
return forName(ir, block.getUnlocalizedName().replaceAll("tile\\.", "") + s, dir);
|
||||
}
|
||||
|
||||
public static IIcon forItem(IIconRegister ir, Item item) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -44,6 +45,8 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
private static final int COUNT = 8;
|
||||
|
||||
IIcon[] doublePlantTopIcons, doublePlantBottomIcons;
|
||||
IIcon[] doublePlantTopIconsAlt, doublePlantBottomIconsAlt;
|
||||
|
||||
final int offset;
|
||||
|
||||
public BlockModDoubleFlower(boolean second) {
|
||||
@@ -133,7 +136,8 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return (func_149887_c(p_149691_2_) ? doublePlantTopIcons : doublePlantBottomIcons)[p_149691_2_ & 7];
|
||||
boolean top = func_149887_c(p_149691_2_);
|
||||
return (ConfigHandler.altFlowerTextures ? (top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt) : (top ? doublePlantTopIcons : doublePlantBottomIcons))[p_149691_2_ & 7];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -143,17 +147,21 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
if(top)
|
||||
meta = world.getBlockMetadata(x, y - 1, z);
|
||||
|
||||
return (top ? doublePlantBottomIcons : doublePlantTopIcons)[meta & 7];
|
||||
return (ConfigHandler.altFlowerTextures ? (top ? doublePlantBottomIconsAlt : doublePlantTopIconsAlt) : (top ? doublePlantBottomIcons : doublePlantTopIcons))[meta & 7];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
doublePlantTopIcons = new IIcon[COUNT];
|
||||
doublePlantBottomIcons = new IIcon[COUNT];
|
||||
doublePlantTopIconsAlt = new IIcon[COUNT];
|
||||
doublePlantBottomIconsAlt = new IIcon[COUNT];
|
||||
for(int i = 0; i < COUNT; i++) {
|
||||
int off = offset(i);
|
||||
doublePlantTopIcons[i] = IconHelper.forName(register, "flower" + off + "Tall0");
|
||||
doublePlantBottomIcons[i] = IconHelper.forName(register, "flower" + off + "Tall1");
|
||||
doublePlantTopIconsAlt[i] = IconHelper.forName(register, "flower" + off + "Tall0", BlockModFlower.ALT_DIR);
|
||||
doublePlantBottomIconsAlt[i] = IconHelper.forName(register, "flower" + off + "Tall1", BlockModFlower.ALT_DIR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user