chest visuals

This commit is contained in:
Cheese 2015-12-14 18:13:19 +11:00
parent 063c87c4fe
commit c508b5ea96
4 changed files with 31 additions and 5 deletions

View File

@ -14,6 +14,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback; import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -174,6 +175,11 @@ public class Treasure
UtilParticle.PlayParticle(type, block.getLocation().add(0.5 + xDif, 0.5 + yDif, 0.5 + zDif), red, 0.2F, 0.2F, 1F, 0, UtilParticle.PlayParticle(type, block.getLocation().add(0.5 + xDif, 0.5 + yDif, 0.5 + zDif), red, 0.2F, 0.2F, 1F, 0,
ViewDist.NORMAL, UtilServer.getPlayers()); ViewDist.NORMAL, UtilServer.getPlayers());
} }
else if (_treasureType == TreasureType.CHRISTMAS)
{
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, block.getLocation().add(0.5f, 0.5f, 0.5f), 0.1f, 0.1F, 0.1F, 0.2F, 5,
ViewDist.NORMAL, UtilServer.getPlayers());
}
else else
{ {
UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0, UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0,

View File

@ -30,7 +30,7 @@ public enum TreasureStyle
CHRISTMAS( CHRISTMAS(
ParticleType.SNOW_SHOVEL, ParticleType.SNOW_SHOVEL,
ParticleType.SNOWBALL_POOF, ParticleType.SNOWBALL_POOF,
ParticleType.FIREWORKS_SPARK, ParticleType.SNOW_SHOVEL,
Sound.FIZZ, Sound.FIZZ,
Sound.CHICKEN_EGG_POP Sound.CHICKEN_EGG_POP
); );

View File

@ -54,18 +54,30 @@ public class BlockChangeAnimation extends Animation
if (getTreasure().getTreasureType() == TreasureType.OLD) if (getTreasure().getTreasureType() == TreasureType.OLD)
continue; continue;
Material newMaterial = getTreasure().getTreasureType() == TreasureType.ANCIENT ? Material.NETHER_BRICK : Material.QUARTZ_BLOCK; Material mat;
if (getTreasure().getTreasureType() == TreasureType.ANCIENT) mat = Material.NETHER_BRICK;
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) mat = Material.QUARTZ_BLOCK;
else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS) mat = Material.ICE;
else
continue;
_blockInfoList.add(new BlockInfo(b)); _blockInfoList.add(new BlockInfo(b));
b.setType(newMaterial); b.setType(mat);
} }
else if (b.getType() == Material.SMOOTH_STAIRS || b.getType() == Material.COBBLESTONE_STAIRS) else if (b.getType() == Material.SMOOTH_STAIRS || b.getType() == Material.COBBLESTONE_STAIRS)
{ {
if (getTreasure().getTreasureType() == TreasureType.OLD) if (getTreasure().getTreasureType() == TreasureType.OLD)
continue; continue;
Material newMaterial = getTreasure().getTreasureType() == TreasureType.ANCIENT ? Material.NETHER_BRICK_STAIRS : Material.QUARTZ_STAIRS; Material mat;
if (getTreasure().getTreasureType() == TreasureType.ANCIENT) mat = Material.NETHER_BRICK_STAIRS;
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) mat = Material.QUARTZ_STAIRS;
else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS) mat = Material.PACKED_ICE;
else
continue;
_blockInfoList.add(new BlockInfo(b)); _blockInfoList.add(new BlockInfo(b));
b.setType(newMaterial); b.setType(mat);
} }
} }
} }

View File

@ -16,6 +16,7 @@ import net.minecraft.server.v1_8_R3.MathHelper;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.treasure.BlockInfo; import mineplex.core.treasure.BlockInfo;
@ -115,6 +116,13 @@ public class ChestSpawnAnimation extends Animation
ViewDist.NORMAL, UtilServer.getPlayers()); ViewDist.NORMAL, UtilServer.getPlayers());
} }
} }
else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS)
{
float spread = 1f - (getTicks() / (float)ANIMATION_DURATION);
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, _centerLocation.clone().add(0, 5, 0), spread, 0.1f, spread, 0, 30,
ViewDist.NORMAL, UtilServer.getPlayers());
}
//Spawn Chest //Spawn Chest
if (getTicks() >= ANIMATION_DURATION) if (getTicks() >= ANIMATION_DURATION)