From 9c48919e4263939714929302d8b49a50b6272306 Mon Sep 17 00:00:00 2001 From: Graphica Date: Sat, 27 May 2017 17:58:53 -0500 Subject: [PATCH] Reduce paint time down to 30 seconds --- .../core/gadget/gadgets/morph/MorphBobRoss.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBobRoss.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBobRoss.java index bbc296896..8a2a18b4d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBobRoss.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBobRoss.java @@ -53,7 +53,7 @@ public class MorphBobRoss extends MorphGadget private static final int DESTROY_LIMIT = 20; /** The # of minutes for which paint blocks exist */ - private static final int PAINT_MINUTES = 1; + private static final int PAINT_SECONDS = 30; /** Height above a player's location at which quotes are to be displayed */ private static final double QUOTE_HEIGHT = 2.25; @@ -278,20 +278,26 @@ public class MorphBobRoss extends MorphGadget if (event.getType() == UpdateType.FASTER) // do paint removal { int limit = 0; + int offset = 0; // destroy up to 20 paint blocks that are older than a set number of minutes while (!_paintBlocks.isEmpty() - && _paintBlocks.get(0).time < System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(PAINT_MINUTES) + && offset < _paintBlocks.size() + && _paintBlocks.get(offset).time < System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(PAINT_SECONDS) && limit < DESTROY_LIMIT) { - Block block = _paintBlocks.remove(0).block; + Block block = _paintBlocks.get(0).block; if (block.getType() == Material.CARPET) { + _paintBlocks.remove(0); block.setType(Material.AIR); + limit++; + } + else + { + offset++; } - - limit++; } } else if (event.getType() == UpdateType.TICK) // do random quote displaying