diff --git a/java/net/universe_factory/minecraft/test/Test.java b/java/net/universe_factory/minecraft/test/Test.java index 999475c..3fad78e 100644 --- a/java/net/universe_factory/minecraft/test/Test.java +++ b/java/net/universe_factory/minecraft/test/Test.java @@ -5,9 +5,11 @@ import java.util.ArrayList; import java.util.Map.Entry; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemCloth; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemSeedFood; import net.minecraft.item.ItemSeeds; @@ -19,6 +21,7 @@ import net.minecraft.world.gen.feature.WorldGenBigTree; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.BiomeEvent.CreateDecorator; +import net.universe_factory.minecraft.test.blocks.BlockGlowfoo; import net.universe_factory.minecraft.test.generic.GenericCrops; import net.universe_factory.minecraft.test.generic.GenericWood; import net.universe_factory.minecraft.test.generic.WorldGenGenericBigTree; @@ -176,6 +179,9 @@ public class Test { public static final Item raddish = new ItemSeedFood(4, 0.4f, raddishField, Blocks.farmland).setTextureName(MODID + ":raddish").setUnlocalizedName( "raddish"); + public static final Block glowfooBlock = new BlockGlowfoo(); + public static final Item glowfoo = new ItemCloth(glowfooBlock); + public static final ExtensibleBiomeDecorator biomeDecorator = new ExtensibleBiomeDecorator(); @EventHandler @@ -198,6 +204,13 @@ public class Test { GameRegistry.registerItem(raddish, "raddish"); GameRegistry.registerBlock(raddishField, null, "raddish"); + GameRegistry.registerBlock(glowfooBlock, null, "glowfoo"); + GameRegistry.registerItem(glowfoo, "glowfoo"); + + for (int i = 0; i < 16; i++) + GameRegistry.addRecipe(new ItemStack(glowfoo, 4, i), "###", "#X#", "###", '#', new ItemStack(Blocks.stained_glass_pane, 1, i), 'X', + Blocks.redstone_block); + biomeDecorator.registerTree(new ExtensibleBiomeDecorator.Tree() { @Override public Entry replaceTree(World world, BiomeGenBase biome, Random random, int x, int y, int z, diff --git a/java/net/universe_factory/minecraft/test/blocks/BlockGlowfoo.java b/java/net/universe_factory/minecraft/test/blocks/BlockGlowfoo.java new file mode 100644 index 0000000..7e88d27 --- /dev/null +++ b/java/net/universe_factory/minecraft/test/blocks/BlockGlowfoo.java @@ -0,0 +1,56 @@ +package net.universe_factory.minecraft.test.blocks; + +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.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.universe_factory.minecraft.test.Test; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockGlowfoo extends Block { + private static final IIcon[] textures = new IIcon[16]; + + public BlockGlowfoo() { + super(Material.glass); + + setHardness(0.3F); + setStepSound(soundTypeGlass); + setLightLevel(1.0F); + setCreativeTab(CreativeTabs.tabDecorations); + setBlockName("glowfoo"); + setBlockTextureName(Test.MODID + ":glowfoo"); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { + for (int i = 0; i < textures.length; i++) + list.add(new ItemStack(item, 1, i)); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return textures[meta % textures.length]; + } + + @SideOnly(Side.CLIENT) + private static int negateMeta(int meta) { + return ~meta & 15; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + for (int i = 0; i < textures.length; i++) + textures[i] = iconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[negateMeta(i)]); + } + + public int damageDropped(int meta) { + return meta; + } +} diff --git a/resources/assets/neoraider_test/lang/en_US.lang b/resources/assets/neoraider_test/lang/en_US.lang index d4f27b0..ac39b16 100644 --- a/resources/assets/neoraider_test/lang/en_US.lang +++ b/resources/assets/neoraider_test/lang/en_US.lang @@ -24,3 +24,20 @@ tile.cucumber.name=Cucumber item.raddish.name=Raddish tile.raddish.name=Raddish + +tile.glowfoo.black.name=Black Light +tile.glowfoo.red.name=Red Light +tile.glowfoo.green.name=Green Light +tile.glowfoo.brown.name=Brown Light +tile.glowfoo.blue.name=Blue Light +tile.glowfoo.purple.name=Purple Light +tile.glowfoo.cyan.name=Cyan Light +tile.glowfoo.silver.name=Light Gray Light +tile.glowfoo.gray.name=Gray Light +tile.glowfoo.pink.name=Pink Light +tile.glowfoo.lime.name=Lime Light +tile.glowfoo.yellow.name=Yellow Light +tile.glowfoo.lightBlue.name=Light Blue Light +tile.glowfoo.magenta.name=Magenta Light +tile.glowfoo.orange.name=Orange Light +tile.glowfoo.white.name=White Light \ No newline at end of file diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo.png b/resources/assets/neoraider_test/textures/blocks/glowfoo.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_black.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_black.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_black.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_black.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_black.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_black.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_blue.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_brown.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_cyan.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_gray.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_green.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_green.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_green.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_green.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_green.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_green.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_light_blue.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_lime.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_magenta.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_orange.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_pink.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_purple.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_red.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_red.png new file mode 100644 index 0000000..4ea7071 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_red.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_red.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_red.xcf new file mode 100644 index 0000000..e50601d Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_red.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_silver.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_white.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_white.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_white.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_white.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_white.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_white.xcf differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.png b/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.png new file mode 100644 index 0000000..006ada8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.png differ diff --git a/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.xcf b/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.xcf new file mode 100644 index 0000000..f84c5a8 Binary files /dev/null and b/resources/assets/neoraider_test/textures/blocks/glowfoo_yellow.xcf differ