Added Alfglass, fancy stuff.

This commit is contained in:
Lizbeth Rika committed 2014-09-09 17:05:56 +01:00
1 parent 974e84e531
commit 586c981b7b
17 files changed
+140 -5

No files matched your search

@@ -0,0 +1,88 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Sep 8, 2014, 6:40:17 PM (GMT)]
*/
package vazkii.botania.common.block;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.recipe.IElvenItem;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockElfGlass extends BlockMod implements IElvenItem, ILexiconable {
private static final int ICON_COUNT = 4;
IIcon[] icons;
public BlockElfGlass() {
super(Material.glass);
setHardness(0.3F);
setStepSound(soundTypeGlass);
setLightLevel(1.0F);
setBlockName(LibBlockNames.ELF_GLASS);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
icons = new IIcon[ICON_COUNT];
for(int i = 0; i < ICON_COUNT; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
blockIcon = icons[0];
}
public boolean isOpaqueCube() {
return false;
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int s) {
int v = (int) Math.floor((double) new Random((x * 10) ^ (y * 20) ^ (z * 30)).nextInt(ICON_COUNT * 100) / 100.0);
return icons[v];
}
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
@Override
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_);
}
@Override
public int getRenderBlockPass() {
return 1;
}
@Override
public boolean isElvenItem(ItemStack stack) {
return true;
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.elvenResources;
}
}
@@ -14,8 +14,10 @@ package vazkii.botania.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import vazkii.botania.api.recipe.IElvenItem;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.core.BotaniaCreativeTab;
import vazkii.botania.common.item.block.ItemBlockElven;
import vazkii.botania.common.item.block.ItemBlockMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -32,7 +34,7 @@ public class BlockMod extends Block {
@Override
public Block setBlockName(String par1Str) {
if(shouldRegisterInNameSet())
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
GameRegistry.registerBlock(this, this instanceof IElvenItem ? ItemBlockElven.class : ItemBlockMod.class, par1Str);
return super.setBlockName(par1Str);
}
@@ -59,7 +59,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable {
setCreativeTab(registerInCreative() ? BotaniaCreativeTab.INSTANCE : null);
}
boolean registerInCreative() {
public boolean registerInCreative() {
return true;
}
@@ -20,6 +20,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.decor.BlockBuriedPetals;
import vazkii.botania.common.block.decor.BlockCustomBrick;
import vazkii.botania.common.block.decor.BlockManaBeacon;
import vazkii.botania.common.block.decor.BlockMiniIsland;
@@ -173,6 +174,7 @@ public final class ModBlocks {
public static Block enderEye;
public static Block starfield;
public static Block rfGenerator;
public static Block elfGlass;
public static Block livingwoodStairs;
public static Block livingwoodSlab;
@@ -291,6 +293,7 @@ public final class ModBlocks {
enderEye = new BlockEnderEye();
starfield = new BlockStarfield();
rfGenerator = new BlockRFGenerator();
elfGlass = new BlockElfGlass();
livingwoodStairs = new BlockLivingwoodStairs();
livingwoodSlab = new BlockLivingwoodSlab(false);
@@ -9,7 +9,7 @@
*
* File Created @ [Jun 28, 2014, 6:43:33 PM (GMT)]
*/
package vazkii.botania.common.block;
package vazkii.botania.common.block.decor;
import java.util.Random;
@@ -20,6 +20,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibBlockNames;
@@ -41,7 +42,7 @@ public class BlockBuriedPetals extends BlockModFlower {
}
@Override
boolean registerInCreative() {
public boolean registerInCreative() {
return false;
}
@@ -111,6 +111,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.signalFlare);
addBlock(ModBlocks.dreamwood);
addBlock(ModBlocks.elfGlass);
addBlock(ModBlocks.prismarine);
addBlock(ModBlocks.seaLamp);
@@ -3,6 +3,7 @@ package vazkii.botania.common.crafting;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.BotaniaAPI;
@@ -18,6 +19,7 @@ public class ModElvenTradeRecipes {
public static RecipeElvenTrade pixieDustRecipe;
public static RecipeElvenTrade dragonstoneRecipe;
public static RecipeElvenTrade elvenQuartzRecipe;
public static RecipeElvenTrade alfglassRecipe;
public static void init() {
dreamwoodRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.dreamwood), LibOreDict.LIVING_WOOD);
@@ -29,6 +31,7 @@ public class ModElvenTradeRecipes {
pixieDustRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 8), LibOreDict.MANA_PEARL);
dragonstoneRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 9), LibOreDict.MANA_DIAMOND);
elvenQuartzRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.quartz, 1, 5), new ItemStack(Items.quartz));
alfglassRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.elfGlass), new ItemStack(Blocks.glass));
}
}
@@ -21,6 +21,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.mana.IManaUsingItem;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibItemNames;
public class ItemDirtRod extends ItemMod implements IManaUsingItem {
@@ -54,6 +55,7 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem {
}
}
}
return true;
}
@@ -0,0 +1,31 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Sep 9, 2014, 5:02:06 PM (GMT)]
*/
package vazkii.botania.common.item.block;
import vazkii.botania.api.recipe.IElvenItem;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class ItemBlockElven extends ItemBlockMod implements IElvenItem {
public ItemBlockElven(Block block) {
super(block);
}
@Override
public boolean isElvenItem(ItemStack stack) {
return ((IElvenItem) field_150939_a).isElvenItem(stack);
}
}
@@ -599,7 +599,7 @@ public final class LexiconData {
elvenMessage.setPriority().setLexiconPages(new PageImage("0", LibResources.ENTRY_ELVEN_GARDE), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"));
elvenResources = new ALexiconEntry(LibLexicon.ALF_RESOURCES, categoryAlfhomancy);
elvenResources.setPriority().setLexiconPages(new PageText("0"), new PageElvenRecipe("1", ModElvenTradeRecipes.dreamwoodRecipe), new PageText("2"), new PageElvenRecipe("3", ModElvenTradeRecipes.elementiumRecipes), new PageElvenRecipe("4", ModElvenTradeRecipes.pixieDustRecipe), new PageElvenRecipe("5", ModElvenTradeRecipes.dragonstoneRecipe), new PageText("6"), new PageElvenRecipe("7", ModElvenTradeRecipes.elvenQuartzRecipe));
elvenResources.setPriority().setLexiconPages(new PageText("0"), new PageElvenRecipe("1", ModElvenTradeRecipes.dreamwoodRecipe), new PageText("2"), new PageElvenRecipe("3", ModElvenTradeRecipes.elementiumRecipes), new PageElvenRecipe("4", ModElvenTradeRecipes.pixieDustRecipe), new PageElvenRecipe("5", ModElvenTradeRecipes.dragonstoneRecipe), new PageText("6"), new PageElvenRecipe("7", ModElvenTradeRecipes.elvenQuartzRecipe), new PageText("8"), new PageElvenRecipe("9", ModElvenTradeRecipes.alfglassRecipe));
gaiaRitual = new ALexiconEntry(LibLexicon.ALF_GAIA_RITUAL, categoryAlfhomancy);
gaiaRitual.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeGaiaPylon), new PageImage("2", LibResources.ENTRY_GAIA_RITUAL), new PageText("3"), new PageText("4"));
@@ -57,6 +57,7 @@ public final class LibBlockNames {
public static final String ENDER_EYE_BLOCK = "enderEyeBlock";
public static final String STARFIELD = "starfield";
public static final String RF_GENERATOR = "rfGenerator";
public static final String ELF_GLASS = "elfGlass";
public static final String SPECIAL_FLOWER_PREFIX = FLOWER + ".";
+3
View File
@@ -429,6 +429,7 @@ tile.botania:customBrick15.name=Azulejo
tile.botania:enderEyeBlock.name=Ender Overseer
tile.botania:starfield.name=Starfield Creator
tile.botania:rfGenerator.name=Mana Fluxfield
tile.botania:elfGlass.name=Alfglass
# FLOWER NAMES
tile.botania:flower..name=Botania Flower
@@ -1557,6 +1558,8 @@ botania.page.elfResources4=Trading for &1Pixie Dust&0
botania.page.elfResources5=Trading for &1Dragonstone&0
botania.page.elfResources6=The &1Elves&0 are also quite keen on the white posh block from the &4Nether&0, &1Nether Quartz&0, the ones they have on their world are tinted green. This quartz works just like any other quartz, be it normal &1Nether Quartz&0 or any of the decorative variants you can find on the &4Decorative Blocks&0 entry under &4Miscelaneous&0.
botania.page.elfResources7=Trading for &1Elven Quartz&0
botania.page.elfResources8=Alfheim also has its own variant of &1Glass&0, in the form of &1Alfglass&0. Its look is rather light and its patterns are randomized depending on where it's placed.
botania.page.elfResources9=Trading for &1Alfglass&0
# -- RITUAL OF GAIA
botania.entry.gaiaRitual=Ritual of Gaia
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB