mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 20:52:20 +00:00
Finished the effect of the Signal Flare.
This commit is contained in:
1 parent
086c371c26
commit
09c8ebc65e
5 files changed
+34
-9
No files matched your search
@@ -57,6 +57,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addBlock(ModBlocks.pylon);
|
||||
addBlock(ModBlocks.unstableBlock);
|
||||
addBlock(ModBlocks.manaBeacon);
|
||||
addItem(ModItems.signalFlare);
|
||||
|
||||
addBlock(ModBlocks.pool);
|
||||
addBlock(ModBlocks.distributor);
|
||||
|
||||
@@ -30,6 +30,7 @@ public class EntitySignalFlare extends Entity {
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,6 +40,9 @@ public class EntitySignalFlare extends Entity {
|
||||
setDead();
|
||||
|
||||
if(!isDead) {
|
||||
if(ticksExisted % 10 == 0)
|
||||
playSound("random.fuse", 1F, 1F);
|
||||
|
||||
float[] color = EntitySheep.fleeceColorTable[getColor()];
|
||||
|
||||
Botania.proxy.setWispFXDistanceLimit(false);
|
||||
|
||||
@@ -14,20 +14,25 @@ package vazkii.botania.common.item;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.entity.EntitySignalFlare;
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSignalFlare extends ItemMod {
|
||||
|
||||
@@ -60,9 +65,16 @@ public class ItemSignalFlare extends ItemMod {
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.explode", 40F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
|
||||
par2World.spawnEntityInWorld(flare);
|
||||
|
||||
int range = 5;
|
||||
List<EntityLivingBase> entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range));
|
||||
for(EntityLivingBase entity : entities)
|
||||
if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled()))
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5));
|
||||
}
|
||||
par1ItemStack.damageItem(200, par3EntityPlayer);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@@ -104,6 +116,12 @@ public class ItemSignalFlare extends ItemMod {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
int storedColor = getColor(par1ItemStack);
|
||||
par3List.add(String.format(StatCollector.translateToLocal("botaniamisc.flareColor"), StatCollector.translateToLocal("botania.color" + storedColor)));
|
||||
}
|
||||
|
||||
public static ItemStack forColor(int color) {
|
||||
ItemStack stack = new ItemStack(ModItems.signalFlare);
|
||||
ItemNBTHelper.setInt(stack, TAG_COLOR, color);
|
||||
|
||||
@@ -10,6 +10,7 @@ botaniamisc.statusUnknown=Unknown Status
|
||||
botaniamisc.color=%s Tinted
|
||||
botaniamisc.manaUsage=Mana Usage
|
||||
botaniamisc.shiftToRead=Shift-right click to read more.
|
||||
botaniamisc.flareColor=%s Rounds
|
||||
|
||||
# COLORS
|
||||
botania.color0=White
|
||||
@@ -190,6 +191,7 @@ item.botania:rune12.name=Rune of Sloth
|
||||
item.botania:rune13.name=Rune of Wrath
|
||||
item.botania:rune14.name=Rune of Envy
|
||||
item.botania:rune15.name=Rune of Pride
|
||||
item.botania:signalFlare.name=Signal Flare
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user