From 184feec875a7b7b5b05df01d069d5f51947f2e15 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Tue, 11 Aug 2015 10:54:24 +0200 Subject: [PATCH] cleany and logic --- .../mineplex/core/bonuses/gui/SpinGui.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/SpinGui.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/SpinGui.java index bea18f676..1daab79ea 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/SpinGui.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/SpinGui.java @@ -32,7 +32,6 @@ import org.bukkit.plugin.Plugin; public class SpinGui extends SimpleGui { - private static final int REWARDS_TO_GENERATE = 200; private static final int HOPPER_SLOT = 4; private static final int CARL_SLOT = 22; private static final int[] LINE_NUMS = { /*-27, -18,*/ -9, 9/*, 18*/ }; @@ -64,15 +63,12 @@ public class SpinGui extends SimpleGui setItem(HOPPER_SLOT, new DisplayItem(new ItemStack(Material.HOPPER))); //setItem(CARL_SLOT, new DisplayItem(carlItem)); - _rewards = new Reward[REWARDS_TO_GENERATE]; + _ticks = new ArrayList<>(); _frame = 0; _pitch = 1; - for (int i = 0; i < REWARDS_TO_GENERATE; i++) - { - _rewards[i] = rewardManager.nextReward(player, null, false, RewardType.SpinnerFiller, true); - } + _ticksPerSwap = 1; @@ -98,8 +94,19 @@ public class SpinGui extends SimpleGui _stopSpinnerAt = _ticks.size(); - _rewards[_stopSpinnerAt % REWARDS_TO_GENERATE + 3] = rewardManager.nextReward(player, null, false, RewardType.SpinnerReal, true); - _reward = _rewards[_stopSpinnerAt % REWARDS_TO_GENERATE + 3]; + //Create Fake Rewards + _rewards = new Reward[_stopSpinnerAt+5]; + for (int i = 0; i < _stopSpinnerAt+5 ; i++) + { + if (i != _stopSpinnerAt) + _rewards[i] = rewardManager.nextReward(player, null, false, RewardType.SpinnerFiller, true); + else + { + _rewards[i] = rewardManager.nextReward(player, null, false, RewardType.SpinnerReal, true); + _reward = _rewards[i]; + } + } + _rewardData = _reward.giveReward("Carls Spinner", getPlayer()); }