From 22f6f243aa672f896d9eb40706c618368b7eb0aa Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Wed, 8 Feb 2017 15:44:05 -0200 Subject: [PATCH] Fixed hover effect Fixed love chest lore being purple --- .../src/mineplex/core/treasure/Treasure.java | 6 ++++++ .../treasure/animation/BlockChangeAnimation.java | 12 ++++++++++++ .../core/treasure/animation/ChestSpawnAnimation.java | 2 +- .../src/mineplex/core/treasure/gui/TreasurePage.java | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java index a2a05912d..71b04ad99 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java @@ -209,6 +209,12 @@ public class Treasure block.getLocation().add(.5 + rX, .7, .5 + rZ)); coloredParticle.display(); } + else if (_treasureType == TreasureType.LOVE_CHEST) + { + int r = (int) (Math.random() * 2); + 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 { UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java index d63a5900e..f98716e24 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java @@ -223,6 +223,18 @@ public class BlockChangeAnimation extends Animation } } } + else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) + { + for (Block c : _chests) + { + if (c.equals(b)) + { + _blockInfoList.add(new BlockInfo(b)); + b.setType(Material.WOOL); + b.setData((byte) 6); + } + } + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java index 4851ef00e..ce268629c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java @@ -117,7 +117,7 @@ public class ChestSpawnAnimation extends Animation _particleLocation.add(_particleDirection); //Play Particles - if (getTreasure().getTreasureType() == TreasureType.OLD) + if (getTreasure().getTreasureType() == TreasureType.OLD || getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) { UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers()); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index a68ec68fd..4fda07f6c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -387,7 +387,7 @@ public class TreasurePage extends ShopPageBase lovechestLore.add(" "); lovechestLore.add(F.value("Love Chests Owned", "" + loveCount)); lovechestLore.add(" "); - lovechestLore.addAll(UtilText.splitLines(new String[]{"Cupid and his hunters have searched far and wide to collect a whole bunch of lovey dovey items. 6 items, no duplicates."}, LineFormat.LORE)); + lovechestLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Cupid and his hunters have searched far and wide to collect a whole bunch of lovey dovey items. 6 items, no duplicates."}, LineFormat.LORE)); lovechestLore.add(" "); if (loveCount > 0) {