Added the Spectranthemum flower.

This commit is contained in:
Lizbeth Rika committed 2015-01-27 19:00:11 +00:00
1 parent f7ace7b0ec
commit 2eb47178fa
8 files changed
+147 -3

No files matched your search

@@ -87,7 +87,8 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
LibBlockNames.SUBTILE_CLAYCONIA,
LibBlockNames.SUBTILE_LOONIUM,
LibBlockNames.SUBTILE_DAFFOMILL,
LibBlockNames.SUBTILE_VINCULOTUS
LibBlockNames.SUBTILE_VINCULOTUS,
LibBlockNames.SUBTILE_SPECTRANTHEMUM
}));
}
@@ -75,6 +75,7 @@ import vazkii.botania.common.block.subtile.functional.SubTileJiyuulia;
import vazkii.botania.common.block.subtile.functional.SubTileLoonuim;
import vazkii.botania.common.block.subtile.functional.SubTilePollidisiac;
import vazkii.botania.common.block.subtile.functional.SubTileRannuncarpus;
import vazkii.botania.common.block.subtile.functional.SubTileSpectranthemum;
import vazkii.botania.common.block.subtile.functional.SubTileTangleberrie;
import vazkii.botania.common.block.subtile.functional.SubTileTigerseye;
import vazkii.botania.common.block.subtile.functional.SubTileVinculotus;
@@ -345,6 +346,7 @@ public final class ModBlocks {
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_LOONIUM, SubTileLoonuim.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DAFFOMILL, SubTileDaffomill.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_VINCULOTUS, SubTileVinculotus.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_SPECTRANTHEMUM, SubTileSpectranthemum.class);
}
private static void registerTile(Class<? extends TileEntity> clazz, String key) {
@@ -0,0 +1,123 @@
/**
* 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 @ [Jan 27, 2015, 4:06:58 PM (GMT)]
*/
package vazkii.botania.common.block.subtile.functional;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.lexicon.LexiconData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SubTileSpectranthemum extends SubTileFunctional {
private static final int COST = 24;
int bindX, bindY = -1, bindZ;
@Override
public void onUpdate() {
super.onUpdate();
if(redstoneSignal == 0 && supertile.getWorldObj().blockExists(bindX, bindY, bindZ)) {
int range = 2;
int x = supertile.xCoord;
int y = supertile.yCoord;
int z = supertile.zCoord;
boolean did = false;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range, z + range + 1));
for(EntityItem item : items) {
if(item.age < 60 || item.isDead)
continue;
ItemStack stack = item.getEntityItem();
if(stack != null) {
int cost = stack.stackSize * COST;
if(mana >= cost) {
spawnExplosionParticles(item);
item.setPosition(bindX + 0.5, bindY + 1.5, bindZ + 0.5);
item.motionX = item.motionY = item.motionZ = 0;
spawnExplosionParticles(item);
if(!supertile.getWorldObj().isRemote) {
mana -= cost;
did = true;
}
}
}
}
if(did)
sync();
}
}
void spawnExplosionParticles(EntityItem item) {
for(int i = 0; i < 10; i++) {
double m = 0.01;
double d0 = item.worldObj.rand.nextGaussian() * m;
double d1 = item.worldObj.rand.nextGaussian() * m;
double d2 = item.worldObj.rand.nextGaussian() * m;
double d3 = 10.0D;
item.worldObj.spawnParticle("explode", item.posX + (double)(item.worldObj.rand.nextFloat() * item.width * 2.0F) - (double)item.width - d0 * d3, item.posY + (double)(item.worldObj.rand.nextFloat() * item.height) - d1 * d3, item.posZ + (double)(item.worldObj.rand.nextFloat() * item.width * 2.0F) - (double)item.width - d2 * d3, d0, d1, d2);
}
}
@Override
public boolean acceptsRedstone() {
return true;
}
@Override
public int getColor() {
return 0x98BCFF;
}
@Override
public int getMaxMana() {
return 16000;
}
@Override
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
boolean bound = super.bindTo(player, wand, x, y, z, side);
if(!bound && (x != bindX || y != bindY || z != bindZ) && (x != supertile.xCoord || y != supertile.yCoord || z != supertile.zCoord)) {
bindX = x;
bindY = y;
bindZ = z;
sync();
return true;
}
return bound;
}
@Override
@SideOnly(Side.CLIENT)
public ChunkCoordinates getBinding() {
return (Minecraft.getMinecraft().thePlayer.isSneaking() && bindY != -1) ? new ChunkCoordinates(bindX, bindY, bindZ) : super.getBinding();
}
@Override
public LexiconEntry getEntry() {
return LexiconData.spectranthemum;
}
}
@@ -63,7 +63,8 @@ public final class ModPetalRecipes {
public static RecipePetals looniumRecipe;
public static RecipePetals daffomillRecipe;
public static RecipePetals vinculotusRecipe;
public static RecipePetals spectranthemumRecipe;
public static void init() {
pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white);
manastarRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MANASTAR), lightBlueMana, greenMana, redMana, cyanMana);
@@ -99,7 +100,8 @@ public final class ModPetalRecipes {
looniumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_LOONIUM), green, green, greenMana, greenMana, gray, grayMana, runeSloth, runeGluttony, runeEnvy, redstoneRoot, pixieDust);
daffomillRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAFFOMILL), white, whiteMana, brown, yellowMana, runeAir, redstoneRoot);
vinculotusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_VINCULOTUS), purpleMana, purpleMana, lime, black, blackMana, black, runeWater, runeSloth, runeLust, redstoneRoot);
spectranthemumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SPECTRANTHEMUM), whiteMana, whiteMana, white, white, cyan, runeEnvy, runeWater, redstoneRoot, pixieDust);
ItemStack stack = new ItemStack(Items.skull, 1, 3);
ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii");
Object[] inputs = new Object[16];
@@ -91,6 +91,7 @@ public final class LexiconData {
public static LexiconEntry loonium;
public static LexiconEntry daffomill;
public static LexiconEntry vinculotus;
public static LexiconEntry spectranthemum;
public static LexiconEntry generatingIntro;
public static LexiconEntry daybloom;
@@ -389,6 +390,9 @@ public final class LexiconData {
vinculotus = new BLexiconEntry(LibLexicon.FFLOWER_VINCULOTUS, categoryFunctionalFlowers);
vinculotus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.vinculotusRecipe));
spectranthemum = new ALexiconEntry(LibLexicon.FFLOWER_SPECTRANTHEMUN, categoryFunctionalFlowers);
spectranthemum.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PagePetalRecipe("3", ModPetalRecipes.spectranthemumRecipe));
// GENERATING FLOWERS ENTRIES
generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers);
generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
@@ -103,6 +103,8 @@ public final class LibBlockNames {
public static final String SUBTILE_LOONIUM = "loonium";
public static final String SUBTILE_DAFFOMILL = "daffomill";
public static final String SUBTILE_VINCULOTUS = "vinculotus";
public static final String SUBTILE_SPECTRANTHEMUM = "spectranthemum";
public static final String SUBTILE_MEDUMONE = "medumone";
public static final String QUARTZ_DARK = "Dark";
public static final String QUARTZ_MANA = "Mana";
@@ -72,6 +72,7 @@ public final class LibLexicon {
public static final String FFLOWER_LOONIUM = "loonium";
public static final String FFLOWER_DAFFOMILL = "daffomill";
public static final String FFLOWER_VINCULOTUS = "vinculotus";
public static final String FFLOWER_SPECTRANTHEMUN = "spectranthemum";
public static final String GFLOWER_INTRO = "gIntro";
public static final String GFLOWER_DAYBLOOM = "daybloom";
@@ -581,6 +581,8 @@ tile.botania:flower.daffomill.name=Daffomill
tile.botania:flower.daffomill.reference=Cook's Assistant
tile.botania:flower.vinculotus.name=Vinculotus
tile.botania:flower.vinculotus.reference=Totally an Extra Utils ripoff
tile.botania:flower.spectranthemum.name=Spectranthemum
tile.botania:flower.spectranthemum.reference=In the shell
# ITEM NAMES
item.botania:lexicon.name=Lexica Botania
@@ -1201,6 +1203,13 @@ botania.entry.vinculotus=Vinculotus
botania.page.vinculotus0=The &1Vinculotus&0 has the power to create a disturbance among any &4Enderman&0's teleportation powers within a fairly large radius around it. For a cost of &4Mana&0, whenever an &4Enderman&0 would teleport anywhere, instead, they're teleported to the location of the &1Vinculotus&0.
botania.page.vinculotus1=Touch this black lotus with your fingers
# -- SPECTRANTHEMUM
botania.entry.spectranthemum=Spectranthemum
botania.page.spectranthemum0=Transporting items a long distance can be an arduous task. Water channels and &1Daffomills&0 won't cut it forever.<br>The &1Spectranthemum&0, at the cost of &4Mana&0 wraps the fabric of reality of any dropped items around it, teleporting them somewhere else in the world.
botania.page.spectranthemum1=In order to specify where the items go, one would use a &1Wand of the Forest&0 in bind mode and bind the flower to a block somewhere, similarly to binding it to a pool.<br>In order to view what block the flower is bound to rather than the pool it's pulling &4Mana&0, one would sneak while looking at it with a wand.
botania.page.spectranthemum2=This flower is governed by the &4axiom of chunkloading&0, by which it'll not function on chunks not loaded. This topic is not addressed in full extent this lexicon.<br>&oRecommended Reading: "Chunks and Chicken", "Anchors of the World".
botania.page.spectranthemum3=(n)spooky(n+2)me
# - GENERATING FLOWERS
# -- AN INTRODUCTION TO GENERATION
botania.entry.gIntro=An Introduction to Generation