cleany and logic
This commit is contained in:
parent
f66a0439e8
commit
184feec875
@ -32,7 +32,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class SpinGui extends SimpleGui
|
public class SpinGui extends SimpleGui
|
||||||
{
|
{
|
||||||
private static final int REWARDS_TO_GENERATE = 200;
|
|
||||||
private static final int HOPPER_SLOT = 4;
|
private static final int HOPPER_SLOT = 4;
|
||||||
private static final int CARL_SLOT = 22;
|
private static final int CARL_SLOT = 22;
|
||||||
private static final int[] LINE_NUMS = { /*-27, -18,*/ -9, 9/*, 18*/ };
|
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(HOPPER_SLOT, new DisplayItem(new ItemStack(Material.HOPPER)));
|
||||||
//setItem(CARL_SLOT, new DisplayItem(carlItem));
|
//setItem(CARL_SLOT, new DisplayItem(carlItem));
|
||||||
|
|
||||||
_rewards = new Reward[REWARDS_TO_GENERATE];
|
|
||||||
_ticks = new ArrayList<>();
|
_ticks = new ArrayList<>();
|
||||||
_frame = 0;
|
_frame = 0;
|
||||||
_pitch = 1;
|
_pitch = 1;
|
||||||
|
|
||||||
for (int i = 0; i < REWARDS_TO_GENERATE; i++)
|
|
||||||
{
|
|
||||||
_rewards[i] = rewardManager.nextReward(player, null, false, RewardType.SpinnerFiller, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
_ticksPerSwap = 1;
|
_ticksPerSwap = 1;
|
||||||
|
|
||||||
@ -98,8 +94,19 @@ public class SpinGui extends SimpleGui
|
|||||||
|
|
||||||
_stopSpinnerAt = _ticks.size();
|
_stopSpinnerAt = _ticks.size();
|
||||||
|
|
||||||
_rewards[_stopSpinnerAt % REWARDS_TO_GENERATE + 3] = rewardManager.nextReward(player, null, false, RewardType.SpinnerReal, true);
|
//Create Fake Rewards
|
||||||
_reward = _rewards[_stopSpinnerAt % REWARDS_TO_GENERATE + 3];
|
_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());
|
_rewardData = _reward.giveReward("Carls Spinner", getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user