Added the Dreadthorne.

This commit is contained in:
Vasco Lavos committed 2014-05-15 16:38:00 +01:00
1 parent 631c4cd076
commit 702f691a48
7 files changed
+72 -5

No files matched your search

@@ -64,6 +64,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
// Functional
LibBlockNames.SUBTILE_JADED_AMARANTHUS,
LibBlockNames.SUBTILE_BELLETHORN,
LibBlockNames.SUBTILE_DREADTHORN,
LibBlockNames.SUBTILE_HEISEI_DREAM,
LibBlockNames.SUBTILE_TIGERSEYE,
LibBlockNames.SUBTILE_ORECHID,
@@ -18,6 +18,7 @@ import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.common.block.subtile.SubTilePureDaisy;
import vazkii.botania.common.block.subtile.functional.SubTileAgricarnation;
import vazkii.botania.common.block.subtile.functional.SubTileBellethorn;
import vazkii.botania.common.block.subtile.functional.SubTileDreadthorn;
import vazkii.botania.common.block.subtile.functional.SubTileExoflame;
import vazkii.botania.common.block.subtile.functional.SubTileFallenKanade;
import vazkii.botania.common.block.subtile.functional.SubTileHeiseiDream;
@@ -51,7 +52,6 @@ import vazkii.botania.common.block.tile.TileTinyPlanet;
import vazkii.botania.common.block.tile.TileTurntable;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibOreDict;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
public final class ModBlocks {
@@ -139,6 +139,7 @@ public final class ModBlocks {
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ARCANE_ROSE, SubTileArcaneRose.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_BELLETHORN, SubTileBellethorn.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DREADTHORN, SubTileDreadthorn.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HEISEI_DREAM, SubTileHeiseiDream.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_TIGERSEYE, SubTileTigerseye.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_JADED_AMARANTHUS, SubTileJadedAmaranthus.class);
@@ -13,6 +13,8 @@ package vazkii.botania.common.block.subtile.functional;
import java.util.List;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
@@ -38,21 +40,39 @@ public class SubTileBellethorn extends SubTileFunctional {
super.onUpdate();
final int range = 6;
final int manaToUse = 24;
final int manaToUse = getManaCost();
if(supertile.getWorldObj().getTotalWorldTime() % 15 == 0) {
if(supertile.getWorldObj().getTotalWorldTime() % 5 == 0) {
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
IEntitySelector selector = getSelector();
for(EntityLivingBase entity : entities) {
if(entity instanceof EntityPlayer)
if(!selector.isEntityApplicable(entity))
continue;
if(entity.hurtTime == 0 && mana >= manaToUse) {
entity.attackEntityFrom(DamageSource.magic, 4);
mana -= manaToUse;
break;
}
}
}
}
public int getManaCost() {
return 24;
}
public IEntitySelector getSelector() {
return new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity entity) {
return !(entity instanceof EntityPlayer);
}
};
}
@Override
public LexiconEntry getEntry() {
@@ -0,0 +1,42 @@
/**
* 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, 4:25:24 PM (GMT)]
*/
package vazkii.botania.common.block.subtile.functional;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityAnimal;
public class SubTileDreadthorn extends SubTileBellethorn {
@Override
public int getColor() {
return 0x260B45;
}
@Override
public IEntitySelector getSelector() {
return new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity var1) {
return var1 instanceof EntityAnimal && ((EntityAnimal) var1).getGrowingAge() == 0;
}
};
}
@Override
public int getManaCost() {
return 30;
}
}
@@ -50,6 +50,7 @@ public final class LibBlockNames {
public static final String SUBTILE_ARCANE_ROSE = "arcanerose";
public static final String SUBTILE_BELLETHORN = "bellethorn";
public static final String SUBTILE_DREADTHORN = "dreadthorn";
public static final String SUBTILE_HEISEI_DREAM = "heiseiDream";
public static final String SUBTILE_TIGERSEYE = "tigerseye";
public static final String SUBTILE_JADED_AMARANTHUS = "jadedAmaranthus";
+2
View File
@@ -153,6 +153,8 @@ tile.botania:flower.arcanerose.reference=Ten blue orbs in the corner
# - FUNCTIONAL
tile.botania:flower.bellethorn.name=Bellethorne
tile.botania:flower.bellethorn.reference=Just a paper cut
tile.botania:flower.dreadthorn.name=Dreadthorne
tile.botania:flower.dreadthorn.reference=Plan C
tile.botania:flower.heiseiDream.name=Heisei Dream
tile.botania:flower.heiseiDream.reference=Heisei heisei kowarete
tile.botania:flower.tigerseye.name=Tigerseye
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB