Changed chest animation
This commit is contained in:
parent
4a496ea4c1
commit
d6605e973d
@ -0,0 +1,33 @@
|
||||
package mineplex.core.particleeffects;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.shape.ShapeWings;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
|
||||
public class CloverEffect extends Effect
|
||||
{
|
||||
|
||||
private ShapeWings _cloverBlack = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '#', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
private ShapeWings _cloverDarkGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
private ShapeWings _cloverGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '*', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
|
||||
public CloverEffect(JavaPlugin plugin, Location location)
|
||||
{
|
||||
super(-1, new EffectLocation(location), plugin, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runEffect()
|
||||
{
|
||||
Location location = getEffectLocation().getLocation();
|
||||
_cloverBlack.displayColored(location, Color.BLACK);
|
||||
_cloverDarkGreen.displayColored(location, new Color(0, 100, 0));
|
||||
_cloverGreen.displayColored(location, Color.GREEN);
|
||||
}
|
||||
|
||||
}
|
@ -49,9 +49,6 @@ import mineplex.core.treasure.animation.LootRareAnimation;
|
||||
import mineplex.core.treasure.animation.LootUncommonAnimation;
|
||||
import mineplex.core.treasure.animation.TreasureRemoveAnimation;
|
||||
|
||||
/**
|
||||
* Created by Shaun on 8/27/2014.
|
||||
*/
|
||||
public class Treasure
|
||||
{
|
||||
private BlockRestore _blockRestore;
|
||||
@ -215,6 +212,15 @@ public class Treasure
|
||||
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
|
||||
UtilParticle.PlayParticle(type, block.getLocation().add(.5 + rX, .7, .5 + rZ), .5f, .5f, .5f, .25f, 1, ViewDist.NORMAL);
|
||||
}
|
||||
else if (_treasureType == TreasureType.ST_PATRICKS)
|
||||
{
|
||||
int r = (int) (Math.random() * 2);
|
||||
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
|
||||
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
|
||||
new DustSpellColor((r == 0) ? Color.GREEN : new Color(0, 100, 0)),
|
||||
block.getLocation().add(.5 + rX, .7, .5 + rZ));
|
||||
coloredParticle.display();
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0,
|
||||
|
@ -17,7 +17,6 @@ import org.bukkit.util.Vector;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.common.shape.ShapeWings;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
@ -44,7 +43,7 @@ public class ChestSpawnAnimation extends Animation
|
||||
private Block _block;
|
||||
private byte _direction;
|
||||
private Location _centerLocation;
|
||||
|
||||
|
||||
private Location _particleLocation;
|
||||
private Vector _particleDirection;
|
||||
|
||||
@ -60,10 +59,6 @@ public class ChestSpawnAnimation extends Animation
|
||||
|
||||
private List<ArmorStand> _bats = Lists.newArrayList();
|
||||
|
||||
private ShapeWings _cloverBlack = new ShapeWings(ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '#', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
private ShapeWings _cloverDarkGreen = new ShapeWings(ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
private ShapeWings _cloverGreen = new ShapeWings(ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '*', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
|
||||
|
||||
public ChestSpawnAnimation(Treasure treasure, Block block, List<BlockInfo> chestBlockInfo, Block openingCenter, double radialOffset, JavaPlugin javaPlugin)
|
||||
{
|
||||
super(treasure);
|
||||
@ -136,7 +131,8 @@ public class ChestSpawnAnimation extends Animation
|
||||
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), newLoc, 0f, 0f, 0f, 0, 1,
|
||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
}
|
||||
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE)
|
||||
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE ||
|
||||
getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
|
||||
{
|
||||
float y = 5 * scale;
|
||||
double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION);
|
||||
@ -155,7 +151,10 @@ public class ChestSpawnAnimation extends Animation
|
||||
}
|
||||
else
|
||||
{
|
||||
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(Color.YELLOW), _centerLocation.clone().add(x * width, y, z * width));
|
||||
DustSpellColor minestrikeColor = new DustSpellColor(Color.YELLOW);
|
||||
DustSpellColor stpatricksColor = new DustSpellColor(Color.GREEN);
|
||||
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST,
|
||||
(getTreasure().getTreasureType() == TreasureType.MINESTRIKE) ? minestrikeColor : stpatricksColor, _centerLocation.clone().add(x * width, y, z * width));
|
||||
coloredParticle.display();
|
||||
}
|
||||
}
|
||||
@ -250,9 +249,7 @@ public class ChestSpawnAnimation extends Animation
|
||||
else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
|
||||
{
|
||||
Location location = _centerLocation.clone().add(0, 5, 0);
|
||||
_cloverBlack.displayColored(location, Color.BLACK);
|
||||
_cloverDarkGreen.displayColored(location, new Color(0, 100, 0));
|
||||
_cloverGreen.displayColored(location, Color.GREEN);
|
||||
|
||||
}
|
||||
|
||||
//Spawn Chest
|
||||
|
Loading…
Reference in New Issue
Block a user