mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 11:49:37 +00:00
Added the Pollidisiac.
This commit is contained in:
1 parent
371e515200
commit
526bf36f8a
8 files changed
+101
-3
No files matched your search
@@ -75,7 +75,8 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
LibBlockNames.SUBTILE_RANNUNCARPUS,
|
||||
LibBlockNames.SUBTILE_TANGLEBERRIE,
|
||||
LibBlockNames.SUBTILE_JIYUULIA,
|
||||
LibBlockNames.SUBTILE_HYACIDUS
|
||||
LibBlockNames.SUBTILE_HYACIDUS,
|
||||
LibBlockNames.SUBTILE_POLLIDISIAC
|
||||
};
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
|
||||
@@ -26,6 +26,7 @@ import vazkii.botania.common.block.subtile.functional.SubTileHopperhock;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileHyacidus;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileJadedAmaranthus;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileJiyuulia;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTilePollidisiac;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileRannuncarpus;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileTangleberrie;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileTigerseye;
|
||||
@@ -153,6 +154,7 @@ public final class ModBlocks {
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_JIYUULIA, SubTileJiyuulia.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_RANNUNCARPUS, SubTileRannuncarpus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HYACIDUS, SubTileHyacidus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_POLLIDISIAC, SubTilePollidisiac.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* 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 @ [May 15, 2014, 5:56:47 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTilePollidisiac extends SubTileFunctional {
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 6;
|
||||
int manaCost = 12;
|
||||
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
for(EntityAnimal animal : animals) {
|
||||
if(mana < manaCost)
|
||||
break;
|
||||
|
||||
int love = ReflectionHelper.getPrivateValue(EntityAnimal.class, animal, LibObfuscation.IN_LOVE);
|
||||
if(animal.getGrowingAge() == 0 && love <= 0) {
|
||||
for(EntityItem item : items) {
|
||||
if(item.isDead || item.age < 60)
|
||||
continue;
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(animal.isBreedingItem(stack)) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
|
||||
mana -= manaCost;
|
||||
|
||||
ReflectionHelper.setPrivateValue(EntityAnimal.class, animal, 800, LibObfuscation.IN_LOVE);
|
||||
animal.setTarget(null);
|
||||
supertile.getWorldObj().setEntityState(animal, (byte)18);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 120;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xCF4919;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,9 @@ package vazkii.botania.common.block.tile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileOpenCrate extends TileSimpleInventory {
|
||||
@@ -30,6 +33,13 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
boolean redstone = false;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal());
|
||||
if(redstoneSide > 0)
|
||||
redstone = true;
|
||||
}
|
||||
|
||||
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
|
||||
if(blockBelow.isAir(worldObj, xCoord, yCoord - 1, zCoord)) {
|
||||
ItemStack stack = getStackInSlot(0);
|
||||
@@ -38,6 +48,10 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
item.motionX = 0;
|
||||
item.motionY = 0;
|
||||
item.motionZ = 0;
|
||||
|
||||
if(redstone)
|
||||
item.age = -200;
|
||||
|
||||
setInventorySlotContents(0, null);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
|
||||
@@ -316,7 +316,7 @@ public final class LexiconData {
|
||||
new PageManaInfusionRecipe("14", ModManaAlchemyRecipes.gunpowderAndFlintRecipes), new PageManaInfusionRecipe("15", ModManaAlchemyRecipes.nameTagRecipe), new PageManaInfusionRecipe("16", ModManaAlchemyRecipes.enderPearlRecipe), new PageManaInfusionRecipe("17", ModManaAlchemyRecipes.redstoneToGlowstoneRecipes), new PageManaInfusionRecipe("18", ModManaAlchemyRecipes.sandRecipe));
|
||||
|
||||
openCrate = new BLexiconEntry(LibLexicon.DEVICE_OPEN_CRATE, categoryDevices);
|
||||
openCrate.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeOpenCrate));
|
||||
openCrate.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeOpenCrate));
|
||||
|
||||
forestEye = new BLexiconEntry(LibLexicon.DEVICE_FOREST_EYE, categoryDevices);
|
||||
forestEye.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeForestEye));
|
||||
|
||||
@@ -63,4 +63,5 @@ public final class LibBlockNames {
|
||||
public static final String SUBTILE_JIYUULIA = "jiyuulia";
|
||||
public static final String SUBTILE_RANNUNCARPUS = "rannuncarpus";
|
||||
public static final String SUBTILE_HYACIDUS = "hyacidus";
|
||||
public static final String SUBTILE_POLLIDISIAC = "pollidisiac";
|
||||
}
|
||||
@@ -37,4 +37,7 @@ public final class LibObfuscation {
|
||||
|
||||
// ItemReed
|
||||
public static final String[] REED_ITEM = new String[] { "field_150935_a", "a" };
|
||||
|
||||
// EntityAnimal
|
||||
public static final String[] IN_LOVE = new String[] { "inLove", "field_70881_d", "bp" };
|
||||
}
|
||||
@@ -180,6 +180,8 @@ tile.botania:flower.rannuncarpus.name=Rannuncarpus
|
||||
tile.botania:flower.rannuncarpus.reference=That's handy
|
||||
tile.botania:flower.hyacidus.name=Hyacidus
|
||||
tile.botania:flower.hyacidus.reference=If you don't walk, it doesn't hurt
|
||||
tile.botania:flower.pollidisiac.name=Pollidisiac
|
||||
tile.botania:flower.pollidisiac.reference=Birds and bees
|
||||
|
||||
# ITEM NAMES
|
||||
item.botania:lexicon.name=Lexica Botania
|
||||
@@ -699,7 +701,8 @@ botania.page.forestEye2=Now you see me...
|
||||
# -- OPEN CRATE
|
||||
botania.entry.openCrate=Open Crate
|
||||
botania.page.openCrate0=Sometimes devices like &1Droppers&0 or &1Dispensers&0 aren't precise or fast enough. A simple solution is to make a crate and punch a hole in the bottom.<br>Yeah, it's that simple. The &1Open Crate&0 accepts items from &1Hoppers&0 or any other means of inserting items, and obviously, drops them directly below it.
|
||||
botania.page.openCrate1=A super crate box
|
||||
botania.page.openCrate1=A little interesting effect the &1Open Crate&0 can do is that, when given a redstone signal, any items it drops are prevented from being caught by flowers like the &1Hopperhock&0, &1Rannuncarpus&0 or &1Pollidisiac&0 for around ten seconds more than usual.
|
||||
botania.page.openCrate2=A super crate box
|
||||
|
||||
# - MYSTICAL INSTRUMENTS
|
||||
# -- MANA BLASTER
|
||||
|
||||
Reference in new issue
Block a user