mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-26 23:03:23 +00:00
Cleanup & reformat
This commit is contained in:
1 parent
f479b19255
commit
38e0cefaa2
76 files changed
+2371
-2766
No files matched your search
@@ -28,98 +28,100 @@ import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class ItemFocusShockwave extends ItemFocusBasic
|
||||
{
|
||||
public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList COST = new AspectList().add(Aspect.AIR, 150).add(Aspect.ENTROPY, 100);
|
||||
|
||||
IIcon depthIcon;
|
||||
private IIcon depthIcon;
|
||||
|
||||
public ItemFocusShockwave ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTM);
|
||||
this.setUnlocalizedName("ItemFocusShockwave");
|
||||
public ItemFocusShockwave () {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusShockwave");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusShockwave");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusShockwave_depth");
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusShockwave");
|
||||
depthIcon = ir.registerIcon("taintedmagic:ItemFocusShockwave_depth");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack stack)
|
||||
{
|
||||
return this.depthIcon;
|
||||
@Override
|
||||
public IIcon getFocusDepthLayerIcon (final ItemStack stack) {
|
||||
return depthIcon;
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
return "SHOCKWAVE" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
return 0xB0B7C4;
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
return COST;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack stack)
|
||||
{
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b)
|
||||
{
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
super.addInformation(stack, player, list, b);
|
||||
list.add(" ");
|
||||
list.add(EnumChatFormatting.BLUE + "+"
|
||||
+ new String(this.isUpgradedWith(stack, FocusUpgradeType.enlarge)
|
||||
? Integer.toString(15 + this.getUpgradeLevel(stack, FocusUpgradeType.enlarge)) : "15")
|
||||
+ new String(isUpgradedWith(stack, FocusUpgradeType.enlarge)
|
||||
? Integer.toString(15 + getUpgradeLevel(stack, FocusUpgradeType.enlarge)) : "15")
|
||||
+ " " + StatCollector.translateToLocal("text.radius"));
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack stack, World world, EntityPlayer player, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
int potency = wand.getFocusPotency(stack);
|
||||
int enlarge = wand.getFocusEnlarge(stack);
|
||||
final int potency = wand.getFocusPotency(stack);
|
||||
final int enlarge = wand.getFocusEnlarge(stack);
|
||||
|
||||
if (wand.consumeAllVis(stack, player, getVisCost(stack), true, false))
|
||||
{
|
||||
List<EntityLivingBase> ents =
|
||||
if (wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {
|
||||
final List<EntityLivingBase> ents =
|
||||
world.getEntitiesWithinAABB(EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1,
|
||||
player.posY + 1, player.posZ + 1)
|
||||
.expand(15.0D + enlarge, 15.0D + enlarge, 15.0D + enlarge));
|
||||
|
||||
if (ents != null && ents.size() > 0) for (EntityLivingBase entity : ents)
|
||||
{
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable())
|
||||
{
|
||||
double dist = TaintedMagicHelper.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents) {
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
final double dist = TaintedMagicHelper.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
|
||||
if (dist < 7.0D) entity.attackEntityFrom(DamageSource.magic, 2.0F + potency);
|
||||
if (dist < 7.0D) {
|
||||
entity.attackEntityFrom(DamageSource.magic, 2.0F + potency);
|
||||
}
|
||||
|
||||
Vector3 vel = TaintedMagicHelper.getVectorBetweenEntities(entity, player);
|
||||
entity.addVelocity(vel.x * (5.0D + potency), 1.5D + (potency * 0.1D), vel.z * (5.0D + potency));
|
||||
final Vector3 vel = TaintedMagicHelper.getVectorBetweenEntities(entity, player);
|
||||
entity.addVelocity(vel.x * (5.0D + potency), 1.5D + potency * 0.1D, vel.z * (5.0D + potency));
|
||||
|
||||
if (world.isRemote) spawnParticles(world, player, entity);
|
||||
if (world.isRemote) {
|
||||
spawnParticles(world, player, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
world.playSoundAtEntity(player, "taintedmagic:shockwave", 5.0F, 1.5F * (float) Math.random());
|
||||
@@ -129,29 +131,26 @@ public class ItemFocusShockwave extends ItemFocusBasic
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void spawnParticles (World world, EntityPlayer player, Entity entity)
|
||||
{
|
||||
FXLightningBolt bolt = new FXLightningBolt(world, player, entity, world.rand.nextLong(), 4);
|
||||
public static void spawnParticles (final World world, final EntityPlayer player, final Entity entity) {
|
||||
final FXLightningBolt bolt = new FXLightningBolt(world, player, entity, world.rand.nextLong(), 4);
|
||||
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(2);
|
||||
bolt.setWidth(0.125F);
|
||||
bolt.finalizeBolt();
|
||||
|
||||
for (int a = 0; a < 5; a++)
|
||||
{
|
||||
Random random = player.worldObj.rand;
|
||||
float x = (float) entity.posX + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
float y = (float) entity.posY + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
float z = (float) entity.posZ + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
for (int a = 0; a < 5; a++) {
|
||||
final Random random = player.worldObj.rand;
|
||||
final float x = (float) entity.posX + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
final float y = (float) entity.posY + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
final float z = (float) entity.posZ + (random.nextFloat() - random.nextFloat()) * 0.6F;
|
||||
Thaumcraft.proxy.sparkle(x, y, z, 2.0F + random.nextFloat(), 2, 0.05F + random.nextFloat() * 0.05F);
|
||||
}
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack stack, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
|
||||
Reference in new issue
Block a user