Added Floral Fertilizer.

This commit is contained in:
Vasco Lavos committed 2014-03-30 14:21:55 +01:00
1 parent 0411d4d7b1
commit c2a01e47da
7 files changed
+97 -20

No files matched your search

@@ -53,6 +53,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.manaPetal);
addItem(ModItems.pestleAndMortar);
addItem(ModItems.dye);
addItem(ModItems.fertilizer);
addItem(ModItems.twigWand);
addItem(ModItems.manaResource);
addItem(ModItems.manaCookie);
@@ -34,7 +34,7 @@ public class BiomeDecorationHandler {
int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8);
if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1))
if(event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1))
event.world.setBlock(x1, y1, z1, ModBlocks.flower, event.rand.nextInt(16), 2);
}
}
@@ -0,0 +1,72 @@
/**
* 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 @ [Mar 29, 2014, 10:41:52 PM (GMT)]
*/
package vazkii.botania.common.item;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibItemNames;
public class ItemFertilizer extends ItemMod {
public ItemFertilizer() {
super();
setUnlocalizedName(LibItemNames.FERTILIZER);
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
final int range = 3;
if(!par3World.isRemote) {
List<ChunkCoordinates> validCoords = new ArrayList();
for(int i = -range; i < (range + 1); i++)
for(int j = -range; j < (range + 1); j++) {
for(int k = 2; k >= 0; k--) {
int x = par4 + i + 1;
int y = par5 + k + 1;
int z = par6 + j + 1;
if(par3World.isAirBlock(x, y, z) && (!par3World.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(par3World, x, y, z))
validCoords.add(new ChunkCoordinates(x, y, z));
}
}
int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 2 : 3);
for(int i = 0; i < flowerCount; i++) {
ChunkCoordinates coords = validCoords.get(par3World.rand.nextInt(validCoords.size()));
validCoords.remove(coords);
par3World.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, par3World.rand.nextInt(16), 1 | 2);
}
par1ItemStack.stackSize--;
} else {
for(int i = 0; i < 15; i++) {
double x = par4 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random();
double y = par5 + 1;
double z = par6 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random();
float red = (float) Math.random();
float green = (float) Math.random();
float blue = (float) Math.random();
Botania.proxy.wispFX(par3World, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F);
}
}
return true;
}
}
@@ -32,6 +32,7 @@ public final class ModItems {
public static Item manaTablet;
public static Item manaGun;
public static Item manaCookie;
public static Item fertilizer;
public static void init() {
lexicon = new ItemLexicon();
@@ -47,7 +48,8 @@ public final class ModItems {
manaTablet = new ItemManaTablet();
manaGun = new ItemManaGun();
manaCookie = new ItemManaCookie();
fertilizer = new ItemFertilizer();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -28,6 +28,7 @@ public final class LibItemNames {
public static final String MANA_TABLET = LibResources.PREFIX_MOD + "manaTablet";
public static final String MANA_GUN = LibResources.PREFIX_MOD + "manaGun";
public static final String MANA_COOKIE = LibResources.PREFIX_MOD + "manaCookie";
public static final String FERTILIZER = LibResources.PREFIX_MOD + "fertilizer";
public static final String[] LENS_NAMES = new String[] {
LibResources.PREFIX_MOD + "lensNormal",
+19 -18
View File
@@ -170,22 +170,22 @@ item.botania:petal12.name=Mystical Brown Petal
item.botania:petal13.name=Mystical Green Petal
item.botania:petal14.name=Mystical Red Petal
item.botania:petal15.name=Mystical Black Petal
item.botania:dye0.name=Floral White Dye
item.botania:dye1.name=Floral Orange Dye
item.botania:dye2.name=Floral Magenta Dye
item.botania:dye3.name=Floral Light Blue Dye
item.botania:dye4.name=Floral Yellow Dye
item.botania:dye5.name=Floral Lime Dye
item.botania:dye6.name=Floral Pink Dye
item.botania:dye7.name=Floral Gray Dye
item.botania:dye8.name=Floral Light Gray Dye
item.botania:dye9.name=Floral Cyan Dye
item.botania:dye10.name=Floral Purple Dye
item.botania:dye11.name=Floral Blue Dye
item.botania:dye12.name=Floral Brown Dye
item.botania:dye13.name=Floral Green Dye
item.botania:dye14.name=Floral Red Dye
item.botania:dye15.name=Floral Black Dye
item.botania:dye0.name=Floral White Powder
item.botania:dye1.name=Floral Orange Powder
item.botania:dye2.name=Floral Magenta Powder
item.botania:dye3.name=Floral Light Blue Powder
item.botania:dye4.name=Floral Yellow Powder
item.botania:dye5.name=Floral Lime Powder
item.botania:dye6.name=Floral Pink Powder
item.botania:dye7.name=Floral Gray Powder
item.botania:dye8.name=Floral Light Gray Powder
item.botania:dye9.name=Floral Cyan Powder
item.botania:dye10.name=Floral Purple Powder
item.botania:dye11.name=Floral Blue Powder
item.botania:dye12.name=Floral Brown Powder
item.botania:dye13.name=Floral Green Powder
item.botania:dye14.name=Floral Red Powder
item.botania:dye15.name=Floral Black Powder
item.botania:pestleAndMortar.name=Pestle and Mortar
item.botania:twigWand.name=Wand of the Forest
item.botania:manasteel.name=Manasteel Ingot
@@ -251,6 +251,7 @@ item.botania:manaTablet.name=Mana Tablet
item.botania:manaGun.name=Mana Blaster
item.botania:compositeLens.name=Composite Mana Lens: %s %s
item.botania:manaCookie.name=Mana Cookie
item.botania:fertilizer.name=Floral Fertilizer
# GUI TEXT
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
@@ -276,10 +277,10 @@ botania.page.lexicon1=Crafting the &1Lexica Botania&0.
botania.entry.flowers=Mystical Flowers
botania.page.flowers0=Around the world, you may stumble upon a large variety of Mystical Flora. Spotting these doesn't take much work as the flowers themselves emit a fair amount of shine.<br>They come in a total of &416 &0different colors.<br>It's also possible to grow these flowers using &1Bone Meal&0.
botania.page.flowers1=Flowers as far as the eye can see...
botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, that can be used for making magical instruments and plants alike.<br>These petals can also be crushed into &1Floral Dye&0, by the use of a &1Pestle and Mortar&0, which function much alike any mundane piece of dye.
botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, that can be used for making magical instruments and plants alike.<br>These petals can also be crushed into &1Floral Power&0, by the use of a &1Pestle and Mortar&0, which functions much alike any mundane piece of dye.
botania.page.flowers3=Plucking Petals off Flowers.
botania.page.flowers4=Crafting the &1Pestle and Mortar&0.
botania.page.flowers5=Grinding Petals into Dye.
botania.page.flowers5=Grinding Petals into Powder.
# -- PETAL APOTHECARY
botania.entry.apothecary=Petal Apothecary
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB