mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 11:49:37 +00:00
Added the Rod of the Hells. Particle spam woot.
This commit is contained in:
1 parent
2f8e9bdbd5
commit
9b2ef03340
11 files changed
+204
-1
No files matched your search
@@ -69,6 +69,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.spawnerMover);
|
||||
addItem(ModItems.rainbowRod);
|
||||
addItem(ModItems.tornadoRod);
|
||||
addItem(ModItems.fireRod);
|
||||
addBlock(ModBlocks.forestDrum);
|
||||
addBlock(ModBlocks.forestEye);
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ public final class MathHelper {
|
||||
public static float pointDistanceSpace(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
return (float) Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2) + Math.pow(z1 - z2, 2));
|
||||
}
|
||||
|
||||
public static float pointDistancePlane(double x1, double y1, double x2, double y2) {
|
||||
return (float) Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
||||
}
|
||||
|
||||
public static void setEntityMotionFromVector(Entity entity, Vector3 originalPosVector, float modifier) {
|
||||
Vector3 entityVector = Vector3.fromEntityCenter(entity);
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* 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 @ [Jun 26, 2014, 12:31:10 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
|
||||
|
||||
public class EntityFlameRing extends Entity {
|
||||
|
||||
String summoner;
|
||||
|
||||
public EntityFlameRing(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityFlameRing(World world, String summoner) {
|
||||
super(world);
|
||||
this.summoner = summoner;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
setSize(0F, 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityUpdate() {
|
||||
super.onEntityUpdate();
|
||||
|
||||
float radius = 5F;
|
||||
float renderRadius = (float) (radius - Math.random());
|
||||
|
||||
for(int i = 0; i < Math.min(90, ticksExisted); i++) {
|
||||
float a = i;
|
||||
if(a % 2 == 0)
|
||||
a = 45 + a;
|
||||
|
||||
if(worldObj.rand.nextInt(ticksExisted < 90 ? 8 : 20) == 0) {
|
||||
float rad = (float) ((a * 4) * Math.PI / 180F);
|
||||
double x = Math.cos(rad) * renderRadius;
|
||||
double z = Math.sin(rad) * renderRadius;
|
||||
|
||||
Botania.proxy.wispFX(worldObj, posX + x, posY - 0.2, posZ + z, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.65F + (float) Math.random() * 0.45F, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F);
|
||||
|
||||
float gs = (float) Math.random() * 0.15F;
|
||||
float smokeRadius = (float) (renderRadius - Math.random() * renderRadius);
|
||||
x = Math.cos(rad) * smokeRadius;
|
||||
z = Math.sin(rad) * smokeRadius;
|
||||
Botania.proxy.wispFX(worldObj, posX + x, posY - 0.2, posZ + z, gs, gs, gs, 0.65F + (float) Math.random() * 0.45F, -0.155F - (float) Math.random() * 0.025F);
|
||||
}
|
||||
}
|
||||
|
||||
if(worldObj.rand.nextInt(20) == 0)
|
||||
worldObj.playSoundAtEntity(this, "fire.fire", 1F, 1F);
|
||||
|
||||
if(worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(ticksExisted >= 300) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
if(ticksExisted > 45) {
|
||||
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius);
|
||||
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLiving.class, boundingBox);
|
||||
|
||||
if(entities.isEmpty())
|
||||
return;
|
||||
|
||||
for(EntityLivingBase entity : entities) {
|
||||
if(entity == null || (entity instanceof EntityPlayer && ((EntityPlayer)entity).getCommandSenderName().equals(summoner)) || MathHelper.pointDistancePlane(posX, posY, entity.posX, entity.posY) > radius)
|
||||
continue;
|
||||
|
||||
entity.setFire(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound var1) {
|
||||
summoner = var1.getString("summoner");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound var1) {
|
||||
var1.setString("summoner", summoner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public final class ModEntities {
|
||||
EntityRegistry.registerModEntity(EntityManaBurst.class, LibEntityNames.MANA_BURST, id++, Botania.instance, 64, 10, true);
|
||||
EntityRegistry.registerModEntity(EntitySignalFlare.class, LibEntityNames.SIGNAL_FLARE, id++, Botania.instance, 2048, 10, false);
|
||||
EntityRegistry.registerModEntity(EntityPixie.class, LibEntityNames.PIXIE, id++, Botania.instance, 16, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityFlameRing.class, LibEntityNames.FLAME_RING, id++, Botania.instance, 32, 40, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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 @ [Jun 26, 2014, 12:08:06 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.entity.EntityFlameRing;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemFireRod extends ItemMod {
|
||||
|
||||
private static final int COST = 900;
|
||||
private static final int COOLDOWN = 1200;
|
||||
|
||||
public ItemFireRod() {
|
||||
setUnlocalizedName(LibItemNames.FIRE_ROD);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
||||
if(!par3World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExact(par1ItemStack, player, COST, false)) {
|
||||
EntityFlameRing entity = new EntityFlameRing(player.worldObj, player.getCommandSenderName());
|
||||
entity.setPosition(x + 0.5, y + 1, z + 0.5);
|
||||
player.worldObj.spawnEntityInWorld(entity);
|
||||
|
||||
par1ItemStack.setItemDamage(COOLDOWN);
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, player, COST, true);
|
||||
par3World.playSoundAtEntity(player, "mob.blaze.breathe", 1F, 1F);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par1ItemStack.isItemDamaged())
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -127,6 +127,7 @@ public final class ModItems {
|
||||
public static Item superTravelBelt;
|
||||
public static Item rainbowRod;
|
||||
public static Item tornadoRod;
|
||||
public static Item fireRod;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -196,7 +197,8 @@ public final class ModItems {
|
||||
superTravelBelt = new ItemSuperTravelBelt();
|
||||
rainbowRod = new ItemRainbowRod();
|
||||
tornadoRod = new ItemTornadoRod();
|
||||
|
||||
fireRod = new ItemFireRod();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -18,5 +18,6 @@ public final class LibEntityNames {
|
||||
public static final String MANA_BURST = LibResources.PREFIX_MOD + "manaBurst";
|
||||
public static final String SIGNAL_FLARE = LibResources.PREFIX_MOD + "signalFlare";
|
||||
public static final String PIXIE = LibResources.PREFIX_MOD + "pixie";
|
||||
public static final String FLAME_RING = LibResources.PREFIX_MOD + "flameRing";
|
||||
|
||||
}
|
||||
@@ -80,6 +80,7 @@ public final class LibItemNames {
|
||||
public static final String SUPER_TRAVEL_BELT = "superTravelBelt";
|
||||
public static final String RAINBOW_ROD = "rainbowRod";
|
||||
public static final String TORNADO_ROD = "tornadoRod";
|
||||
public static final String FIRE_ROD = "fireRod";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -512,6 +512,7 @@ item.botania:pixieRing.name=Great Fairy Ring
|
||||
item.botania:superTravelBelt.name=Globetrotter's Sash
|
||||
item.botania:rainbowRod.name=Rod of Bifrost
|
||||
item.botania:tornadoRod.name=Rod of the Skies
|
||||
item.botania:fireRod.name=Rod of the Hells
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania, %s Edition's Index - Pick which category you would like to study:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"animation": {
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 2
|
||||
}, {
|
||||
"index": 1,
|
||||
"time": 2
|
||||
}, {
|
||||
"index": 2,
|
||||
"time": 2
|
||||
}, {
|
||||
"index": 3,
|
||||
"time": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user