Added Ilus Element mod for merging

Content will be merged into the core as an optional decor block/item
set.
This commit is contained in:
DarkGuardsman 2013-09-03 17:24:43 -04:00
parent 933b4e44b4
commit f19ac591ae
28 changed files with 858 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 KiB

View file

@ -0,0 +1,11 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0.000000
Ka 0.000000 0.000000 0.000000
Kd 0.512000 0.512000 0.512000
Ks 0.800000 0.800000 0.800000
Ni 1.000000
d 1.000000
illum 2

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -0,0 +1,95 @@
# IllustriousElements Language Properties
# @author DarkGuardsman
# Blocks
tile.colorSand.Black.name = Black Sand
tile.colorSand.Red.name = Red Sand
tile.colorSand.Green.name = Green Sand
tile.colorSand.Brown.name = Brown Sand
tile.colorSand.Blue.name = Blue Sand
tile.colorSand.Purple.name = Purple Sand
tile.colorSand.Cyan.name = Cyan Sand
tile.colorSand.Silver.name = Silver Sand
tile.colorSand.Gray.name = Grey Sand
tile.colorSand.Pink.name = Pink Sand
tile.colorSand.Lime.name = Lime Sand
tile.colorSand.Yellow.name = Yellow Sand
tile.colorSand.LightBlue.name = Light Blue Sand
tile.colorSand.Magenta.name = Magenta Sand
tile.colorSand.Orange.name = Orange Sand
tile.colorSand.White.name = White Sand
tile.GlowGlass.Black.name = Black Glowing Glass
tile.GlowGlass.Red.name = Red Glowing Glass
tile.GlowGlass.Green.name = Green Glowing Glass
tile.GlowGlass.Brown.name = Brown Glowing Glass
tile.GlowGlass.Blue.name = Blue Glowing Glass
tile.GlowGlass.Purple.name = Purple Glowing Glass
tile.GlowGlass.Cyan.name = Cyan Glowing Glass
tile.GlowGlass.Silver.name = Silver Glowing Glass
tile.GlowGlass.Gray.name = Grey Glowing Glass
tile.GlowGlass.Pink.name = Pink SGlowing Glass
tile.GlowGlass.Lime.name = Lime Glowing Glass
tile.GlowGlass.Yellow.name = Yellow Glowing Glass
tile.GlowGlass.LightBlue.name = Light Blue Glowing Glass
tile.GlowGlass.Magenta.name = Magenta Glowing Glass
tile.GlowGlass.Orange.name = Orange Glowing Glass
tile.GlowGlass.White.name = White Glowing Glass
tile.StainedGlass.Black.name = Black Glass
tile.StainedGlass.Red.name = Red Glass
tile.StainedGlass.Green.name = Green Glass
tile.StainedGlass.Brown.name = Brown Glass
tile.StainedGlass.Blue.name = Blue Glass
tile.StainedGlass.Purple.name = Purple Glass
tile.StainedGlass.Cyan.name = Cyan Glass
tile.StainedGlass.Silver.name = Silver Glass
tile.StainedGlass.Gray.name = Grey Glass
tile.StainedGlass.Pink.name = Pink Glass
tile.StainedGlass.Lime.name = Lime GGlass
tile.StainedGlass.Yellow.name = Yellow Glass
tile.StainedGlass.LightBlue.name = Light Blue Glass
tile.StainedGlass.Magenta.name = Magenta Glass
tile.StainedGlass.Orange.name = Orange Glass
tile.StainedGlass.White.name = White Glass
tile.basalt.name = Basalt
tile.basaltcobble.name = Basalt CobbleStone
tile.basaltbrick.name = Basalt Bricks
tile.basaltchiseled.name = Chiseled Basalt Bricks
tile.basaltmossy.name = Mossy Basalt Bricks
tile.basaltcracked.name = Cracked Basalt Bricks
item.GlowRefinedSand.Black.name = Black Glowing Refined Sand
item.GlowRefinedSand.Red.name = Red Glowing Refined Sand
item.GlowRefinedSand.Green.name = Green Glowing Refined Sand
item.GlowRefinedSand.Brown.name = Brown Glowing Refined Sand
item.GlowRefinedSand.Blue.name = Blue Glowing Refined Sand
item.GlowRefinedSand.Purple.name = Purple Glowing Refined Sand
item.GlowRefinedSand.Cyan.name = Cyan Glowing Refined Sand
item.GlowRefinedSand.Silver.name = Silver Glowing Refined Sand
item.GlowRefinedSand.Gray.name = Grey Glowing Refined Sand
item.GlowRefinedSand.Pink.name = Pink Glowing Refined Sand
item.GlowRefinedSand.Lime.name = Lime Glowing Refined Sand
item.GlowRefinedSand.Yellow.name = Yellow Glowing Refined Sand
item.GlowRefinedSand.Light Blue.name = Light Blue Glowing Refined Sand
item.GlowRefinedSand.Magenta.name = Magenta Glowing Refined Sand
item.GlowRefinedSand.Orange.name = Orange Glowing Refined Sand
item.GlowRefinedSand.White.name = White Glowing Refined Sand
item.RefinedSand.Black.name = Black Refined Sand
item.RefinedSand.Red.name = Red Refined Sand
item.RefinedSand.Green.name = Green Refined Sand
item.RefinedSand.Brown.name = Brown Refined Sand
item.RefinedSand.Blue.name = Blue Refined Sand
item.RefinedSand.Purple.name = Purple Refined Sand
item.RefinedSand.Cyan.name = Cyan Refined Sand
item.RefinedSand.Silver.name = Silver Refined Sand
item.RefinedSand.Gray.name = Grey Refined Sand
item.RefinedSand.Pink.name = Pink Refined Sand
item.RefinedSand.Lime.name = Lime Refined Sand
item.RefinedSand.Yellow.name = Yellow Refined Sand
item.RefinedSand.Light Blue.name = Light Blue Refined Sand
item.RefinedSand.Magenta.name = Magenta Refined Sand
item.RefinedSand.Orange.name = Orange Refined Sand
item.RefinedSand.White.name = White Refined Sand

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

View file

@ -0,0 +1,15 @@
package dark.illus;
public class ClientProxy extends CommonProxy
{
public void preInit()
{
}
@Override
public void init()
{
}
}

View file

@ -0,0 +1,21 @@
package dark.illus;
public class CommonProxy
{
public void preInit()
{
}
public void postInit()
{
}
public void init()
{
}
}

View file

@ -0,0 +1,160 @@
package dark.illus;
import java.awt.Color;
import java.io.File;
import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.illus.blocks.colored.BlockBasalt;
import dark.illus.blocks.colored.BlockColorGlass;
import dark.illus.blocks.colored.BlockColorSand;
import dark.illus.blocks.colored.ItemBlockBasalt;
import dark.illus.blocks.colored.ItemBlockColored;
import dark.illus.items.ItemColored;
@Mod(modid = IllustriousElements.MOD_ID, name = IllustriousElements.MOD_NAME, version = IllustriousElements.VERSION)
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class IllustriousElements
{
// @Mod Prerequisites
public static final String MAJOR_VERSION = "@MAJOR@";
public static final String MINOR_VERSION = "@MINOR@";
public static final String REVIS_VERSION = "@REVIS@";
public static final String BUILD_VERSION = "@BUILD@";
// @Mod
public static final String MOD_ID = "Illustrious_Elements";
public static final String MOD_NAME = "Illustrious_Elements";
public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION;
@Instance(IllustriousElements.MOD_ID)
public static IllustriousElements Instance;
@SidedProxy(clientSide = "dark.illus.ClientProxy", serverSide = "dark.illus.CommonProxy")
public static CommonProxy proxy;
public static final String RESOURCE_PATH = "/mods/illus/";
public static final String TEXTURE_DIRECTORY = RESOURCE_PATH + "textures/";
public static final String GUI_DIRECTORY = TEXTURE_DIRECTORY + "gui/";
public static final String BLOCK_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "blocks/";
public static final String ITEM_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "items/";
public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "models/";
public static final String LANGUAGE_PATH = RESOURCE_PATH + "lang/";
public static final String TEXTURE_NAME_PREFIX = "illus:";
// Variables //
private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" };
static Configuration config = new Configuration(new File(Loader.instance().getConfigDir(), "IllustriousElements.cfg"));
public static Logger FMLog = Logger.getLogger(MOD_NAME);
public static final String[] dyeColorNames = new String[] { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "Silver", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" };
public static final Color[] dyeColors = new Color[] { Color.black, Color.red, Color.green, new Color(139, 69, 19), Color.BLUE, new Color(75, 0, 130), Color.cyan, new Color(192, 192, 192), Color.gray, Color.pink, new Color(0, 255, 0), Color.yellow, new Color(135, 206, 250), Color.magenta, Color.orange, Color.white };
// Blocks //
public static Block blockStainGlass;
public static Block blockColorSand;
public static Block blockBasalt;
public static Block blockGlowGlass;
// Item //
public static Item itemRefinedSand;
public static Item itemGlowingSand;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
proxy.preInit();
// // Configuration ////
config.load();
blockStainGlass = new BlockColorGlass(config.getBlock(Configuration.CATEGORY_BLOCK, "StainedGlassBlockID", 1200).getInt(), "StainedGlass");
blockColorSand = new BlockColorSand(config.getBlock(Configuration.CATEGORY_BLOCK, "ColoredSandBlockID", 1201).getInt());
blockBasalt = new BlockBasalt(config.getBlock(Configuration.CATEGORY_BLOCK, "ExtraBlocksBlockID", 1202).getInt());
blockGlowGlass = new BlockColorGlass(config.getBlock(Configuration.CATEGORY_BLOCK, "GlowingGlassBlockID", 1203).getInt(), "GlowGlass").setLightOpacity(2).setLightValue(1);
itemRefinedSand = new ItemColored(config.getItem(Configuration.CATEGORY_ITEM, "RefinedSandItemID", 30010).getInt(), "RefinedSand");
itemGlowingSand = new ItemColored(config.getItem(Configuration.CATEGORY_ITEM, "GlowingRefinedSandItemID", 30020).getInt(), "GlowRefinedSand");
config.save();
// // Registration ////
GameRegistry.registerBlock(blockStainGlass, ItemBlockColored.class, "stainGlass");
GameRegistry.registerBlock(blockColorSand, ItemBlockColored.class, "stainSand");
GameRegistry.registerBlock(blockBasalt, ItemBlockBasalt.class, "extraBlocks");
GameRegistry.registerBlock(blockGlowGlass, ItemBlockColored.class, "stainGlowGlass");
}
@EventHandler
public void generalLoad(FMLInitializationEvent event)
{
proxy.init();
// // Block Names ////
FMLog.info(" Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages.");
}
@EventHandler
public void postLoad(FMLPostInitializationEvent event)
{
proxy.postInit();
// // Block Recipes ////
// Stained Glass //
for (int i = 0; i < dyeColorNames.length; i++)
{
FurnaceRecipes.smelting().addSmelting(IllustriousElements.itemRefinedSand.itemID, i, new ItemStack(IllustriousElements.blockStainGlass, 1, i), 10F);
}
// Glowing Glass //
for (int i = 0; i < dyeColorNames.length; i++)
{
FurnaceRecipes.smelting().addSmelting(IllustriousElements.itemGlowingSand.itemID, i, new ItemStack(IllustriousElements.blockGlowGlass, 1, i), 10F);
}
// Colored Sand //
for (int j = 0; j < dyeColorNames.length; j++)
{
GameRegistry.addRecipe(new ItemStack(blockColorSand, 8, j), new Object[] { "SSS", "SDS", "SSS", 'S', Block.sand, 'D', new ItemStack(Item.dyePowder, 1, j) });
}
// Extra Block //
GameRegistry.addShapelessRecipe(new ItemStack(blockBasalt, 1, BlockBasalt.block.COBBLE.ordinal()), new Object[] { new ItemStack(blockBasalt, 1, BlockBasalt.block.STONE.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(blockBasalt, 1, BlockBasalt.block.MOSSY.ordinal()), new Object[] { new ItemStack(blockBasalt, 1, BlockBasalt.block.BRICK.ordinal()), Block.vine });
GameRegistry.addShapelessRecipe(new ItemStack(blockBasalt, 2, BlockBasalt.block.CRACKED.ordinal()), new Object[] { new ItemStack(blockBasalt, 1, BlockBasalt.block.BRICK.ordinal()), new ItemStack(blockBasalt, 1, BlockBasalt.block.BRICK.ordinal()) });
GameRegistry.addRecipe(new ItemStack(blockBasalt, 4, BlockBasalt.block.BRICK.ordinal()), new Object[] { "SS", "SS", 'S', new ItemStack(blockBasalt, 1, BlockBasalt.block.STONE.ordinal()) });
GameRegistry.addRecipe(new ItemStack(blockBasalt, 8, BlockBasalt.block.CHISILED.ordinal()), new Object[] { "SSS", "S S", "SSS", 'S', new ItemStack(blockBasalt, 1, BlockBasalt.block.STONE.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(blockBasalt, 2, BlockBasalt.block.COBBLE.ordinal()), new Object[] { Block.cobblestone, new ItemStack(blockBasalt, 1, BlockBasalt.block.STONE.ordinal()) });
GameRegistry.addSmelting(Block.stone.blockID, new ItemStack(blockBasalt, 1, BlockBasalt.block.STONE.ordinal()), 1f);
// // Item Recipes ////
// Refined Sand //
for (int j = 0; j < dyeColorNames.length; j++)
{
GameRegistry.addShapelessRecipe(new ItemStack(itemRefinedSand, 1, j), new Object[] { new ItemStack(blockColorSand, 1, j) });
}
// Glowing Refined Sand //
for (int j = 0; j < dyeColorNames.length; j++)
{
GameRegistry.addShapelessRecipe(new ItemStack(itemGlowingSand, 1, j), new Object[] { new ItemStack(itemRefinedSand, 1, j), Item.redstone });
}
}
}

View file

@ -0,0 +1,72 @@
package dark.illus;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.registry.LanguageRegistry;
/** A class to help you out with translations.
*
* @author Calclavia */
public class TranslationHelper
{
/** Loads all the language files for a mod. This supports the loading of "child" language files
* for sub-languages to be loaded all from one file instead of creating multiple of them. An
* example of this usage would be different Spanish sub-translations (es_MX, es_YU).
*
* @param languagePath - The path to the mod's language file folder.
* @param languageSupported - The languages supported. E.g: new String[]{"en_US", "en_AU",
* "en_UK"}
* @return The amount of language files loaded successfully. */
public static int loadLanguages(String languagePath, String[] languageSupported)
{
int languages = 0;
/** Load all languages. */
for (String language : languageSupported)
{
LanguageRegistry.instance().loadLocalization(languagePath + language + ".properties", language, false);
if (LanguageRegistry.instance().getStringLocalization("children", language) != "")
{
try
{
String[] children = LanguageRegistry.instance().getStringLocalization("children", language).split(",");
for (String child : children)
{
if (child != "" || child != null)
{
LanguageRegistry.instance().loadLocalization(languagePath + language + ".properties", child, false);
languages++;
}
}
}
catch (Exception e)
{
FMLLog.severe("Failed to load a child language file.");
e.printStackTrace();
}
}
languages++;
}
return languages;
}
/** Gets the local text of your translation based on the given key. This will look through your
* mod's translation file that was previously registered. Make sure you enter the full name
*
* @param key - e.g tile.block.name
* @return The translated string or the default English translation if none was found. */
public static String getLocal(String key)
{
String text = LanguageRegistry.instance().getStringLocalization(key);
if (text == null || text == "")
{
text = LanguageRegistry.instance().getStringLocalization(key, "en_US");
}
return text;
}
}

View file

@ -0,0 +1,92 @@
package dark.illus.blocks.colored;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.illus.IllustriousElements;
public class BlockBasalt extends Block
{
private Icon[] icons;
public final static String[] blockNames = new String[] { "basalt", "basaltcobble", "basaltbrick", "basaltchiseled", "basaltcracked", "basaltmossy" };
public enum block
{
STONE("basalt"),
COBBLE("basaltcobble"),
BRICK("basaltbrick"),
CHISILED("basaltchiseled"),
CRACKED("basaltcracked"),
MOSSY("basaltmossy");
public String name;
private block(String name)
{
this.name = name;
}
}
public BlockBasalt(int par1)
{
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabDecorations);
this.setHardness(2f);
this.setResistance(2f);
this.setUnlocalizedName("basalt");
this.setStepSound(soundStoneFootstep);
this.setLightValue(1);
}
@Override
public int quantityDropped(Random par1Random)
{
return 1;
}
@Override
public boolean renderAsNormalBlock()
{
return true;
}
@Override
protected boolean canSilkHarvest()
{
return true;
}
public Icon getIcon(int side, int meta)
{
if (meta < this.icons.length)
{
return this.icons[meta];
}
return blockIcon;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconReg)
{
this.icons = new Icon[16];
for (int i = 0; i < this.blockNames.length; ++i)
{
this.icons[i] = iconReg.registerIcon(IllustriousElements.TEXTURE_NAME_PREFIX + this.blockNames[i]);
}
}
@Override
public int damageDropped(int par1)
{
return par1;
}
}

View file

@ -0,0 +1,51 @@
package dark.illus.blocks.colored;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockColorGlass extends BlockColored
{
public BlockColorGlass(int id, String name)
{
super(name, id, Material.glass);
this.setCreativeTab(CreativeTabs.tabDecorations);
this.setHardness(.5f);
this.setResistance(.5f);
this.setStepSound(soundGlassFootstep);
}
@Override
public int quantityDropped(Random par1Random)
{
return 0;
}
@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
return 1;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
protected boolean canSilkHarvest()
{
return true;
}
}

View file

@ -0,0 +1,95 @@
package dark.illus.blocks.colored;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.world.World;
public class BlockColorSand extends BlockColored
{
public BlockColorSand(int par1)
{
super("colorSand", par1, Material.sand);
this.setCreativeTab(CreativeTabs.tabDecorations);
this.setHardness(1f);
this.setResistance(.5f);
}
public static boolean fallInstantly = true;
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
}
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
}
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote)
{
this.tryToFall(par1World, par2, par3, par4);
}
}
private void tryToFall(World par1World, int par2, int par3, int par4)
{
int meta = par1World.getBlockMetadata(par2, par3, par4);
if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0)
{
byte var8 = 32;
if (!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
{
if (!par1World.isRemote)
{
return;
}
}
else
{
par1World.setBlock(par2, par3, par4, 0);
while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0)
{
--par3;
}
if (par3 > 0)
{
par1World.setBlock(par2, par3, par4, this.blockID, meta, 3);
}
}
}
}
public int tickRate()
{
return 3;
}
public static boolean canFallBelow(World par0World, int par1, int par2, int par3)
{
int var4 = par0World.getBlockId(par1, par2, par3);
if (var4 == 0)
{
return true;
}
else if (var4 == Block.fire.blockID)
{
return true;
}
else
{
Material var5 = Block.blocksList[var4].blockMaterial;
return var5 == Material.water ? true : var5 == Material.lava;
}
}
}

View file

@ -0,0 +1,96 @@
package dark.illus.blocks.colored;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.illus.IllustriousElements;
public class BlockColored extends Block
{
@SideOnly(Side.CLIENT)
private Icon[] icons;
private Icon singleIcon;
/* IS THIS BLOCK ABLE TO BE COLORED */
boolean colorized = true;
public BlockColored(String name, int id, Material par2Material)
{
super(id, par2Material);
this.setUnlocalizedName(name);
}
@SideOnly(Side.CLIENT)
@Override
public Icon getIcon(int side, int meta)
{
if (colorized)
{
return this.singleIcon;
}
return this.icons[~meta & 15];
}
@Override
public int damageDropped(int meta)
{
return meta;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(int par1, CreativeTabs tab, List contentList)
{
for (int j = 0; j < 16; ++j)
{
contentList.add(new ItemStack(par1, 1, j));
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconReg)
{
if (colorized)
{
this.singleIcon = iconReg.registerIcon(IllustriousElements.TEXTURE_NAME_PREFIX + this.getUnlocalizedName().replace("tile.", ""));
}
else
{
this.icons = new Icon[16];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconReg.registerIcon(IllustriousElements.TEXTURE_NAME_PREFIX + IllustriousElements.dyeColorNames[~i & 15] + this.getUnlocalizedName().replace("tile.", ""));
}
}
}
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
{
return this.getRenderColor(world.getBlockMetadata(x, y, z));
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderColor(int meta)
{
if (this.colorized)
{
return IllustriousElements.dyeColors[meta & 15].getRGB();
}
return super.getRenderColor(meta);
}
}

View file

@ -0,0 +1,41 @@
package dark.illus.blocks.colored;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockBasalt extends ItemBlock
{
public ItemBlockBasalt(int par1)
{
super(par1);
this.setMaxDamage(0);
this.setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
int meta = itemstack.getItemDamage();
return "tile." + BlockBasalt.blockNames[meta];
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < BlockBasalt.blockNames.length; i++)
{
par3List.add(new ItemStack(this, 1, i));
}
}
}

View file

@ -0,0 +1,34 @@
package dark.illus.blocks.colored;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import dark.illus.IllustriousElements;
public class ItemBlockColored extends ItemBlock
{
public ItemBlockColored(int par1)
{
super(par1);
this.setMaxDamage(0);
this.setHasSubtypes(true);
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + IllustriousElements.dyeColorNames[par1ItemStack.getItemDamage()];
}
@Override
public String getUnlocalizedName()
{
return Block.blocksList[this.getBlockID()].getUnlocalizedName();
}
}

View file

@ -0,0 +1,75 @@
package dark.illus.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.illus.IllustriousElements;
public class ItemColored extends Item
{
private Icon theIcon;
@SideOnly(Side.CLIENT)
public ItemColored(int par1, String name)
{
super(par1);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setCreativeTab(CreativeTabs.tabMaterials);
this.setUnlocalizedName(name);
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{
return IllustriousElements.dyeColors[par1ItemStack.getItemDamage() % 16].getRGB();
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
/*
* @SideOnly(Side.CLIENT) public Icon getIconFromDamageForRenderPass(int par1, int par2) {
* return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); }
*/
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(IllustriousElements.TEXTURE_NAME_PREFIX + "dust");
this.theIcon = par1IconRegister.registerIcon("glowingPowder_overlay");
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
public final String getUnlocalizedName(ItemStack par1ItemStack)
{
return this.getUnlocalizedName() + "." + IllustriousElements.dyeColorNames[par1ItemStack.getItemDamage()];
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < IllustriousElements.dyeColorNames.length; i++)
{
par3List.add(new ItemStack(par1, 1, i));
}
}
}