Change playwire button, modify player messages, and fix availability bugs
This commit is contained in:
parent
0070fed6c7
commit
b374d728f5
@ -1,14 +1,15 @@
|
|||||||
package mineplex.core.bonuses.gui.buttons;
|
package mineplex.core.bonuses.gui.buttons;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.gui.GuiItem;
|
import mineplex.core.gui.GuiItem;
|
||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.playwire.PlayWireManager;
|
import mineplex.core.playwire.PlayWireManager;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.inventory.ClickType;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -20,11 +21,11 @@ public class PlayWireButton implements GuiItem
|
|||||||
.setTitle(C.cGreen + C.Bold + "Watch an Ad!")
|
.setTitle(C.cGreen + C.Bold + "Watch an Ad!")
|
||||||
.addLore(
|
.addLore(
|
||||||
C.cWhite + "You have already redeemed your",
|
C.cWhite + "You have already redeemed your",
|
||||||
C.cWhite + "rewards for watching the Ad!",
|
C.cWhite + "rewards for watching the Ads!",
|
||||||
" ",
|
" ",
|
||||||
C.cWhite + "You can watch it again, but you won't earn any shards!",
|
C.cWhite + "You can watch some more, but you won't earn any rewards!",
|
||||||
" ",
|
" ",
|
||||||
C.cWhite + "You can watch the Ad once every hour.",
|
C.cWhite + "You can watch 5 Ads every 24 hours.",
|
||||||
" ",
|
" ",
|
||||||
C.cWhite + "Ads help us keep Mineplex awesome",
|
C.cWhite + "Ads help us keep Mineplex awesome",
|
||||||
C.cRedB + "Be sure to have your AdBlocker disabled!",
|
C.cRedB + "Be sure to have your AdBlocker disabled!",
|
||||||
@ -36,11 +37,10 @@ public class PlayWireButton implements GuiItem
|
|||||||
private static final ItemStack ENABLED_ICON = new ItemBuilder(Material.TRIPWIRE_HOOK)
|
private static final ItemStack ENABLED_ICON = new ItemBuilder(Material.TRIPWIRE_HOOK)
|
||||||
.setTitle(C.cGreen + C.Bold + "Watch an Ad!")
|
.setTitle(C.cGreen + C.Bold + "Watch an Ad!")
|
||||||
.addLore(
|
.addLore(
|
||||||
C.cYellow + "Earn a 100 Shard Reward",
|
C.cYellow + "Earn 1 Carl Spin Ticket",
|
||||||
C.cYellow + "and 1 Carl Spin Ticket",
|
|
||||||
C.cWhite + "by checking out our partner's Advertisement",
|
C.cWhite + "by checking out our partner's Advertisement",
|
||||||
" ",
|
" ",
|
||||||
C.cWhite + "You can watch the Ad once every hour.",
|
C.cWhite + "You can watch 5 Ads every 24 hours.",
|
||||||
" ",
|
" ",
|
||||||
C.cWhite + "Ads help us keep Mineplex awesome",
|
C.cWhite + "Ads help us keep Mineplex awesome",
|
||||||
C.cRedB + "Be sure to have your AdBlocker disabled!",
|
C.cRedB + "Be sure to have your AdBlocker disabled!",
|
||||||
|
@ -88,7 +88,7 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
|
|||||||
{
|
{
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
|
|
||||||
return data == null || data.getTicketRefresh() >= now || data.getTicketsRemaining() <= 0;
|
return data == null || (data.getTicketRefresh() < now || data.getTicketRefresh() == -1) || data.getTicketsRemaining() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attemptRedeem(Player player)
|
public void attemptRedeem(Player player)
|
||||||
@ -167,6 +167,11 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response == ResponseType.UNCOUNTED)
|
||||||
|
{
|
||||||
|
response = ResponseType.UNFILLED;
|
||||||
|
}
|
||||||
|
|
||||||
if (response == ResponseType.COUNTED)
|
if (response == ResponseType.COUNTED)
|
||||||
{
|
{
|
||||||
attemptRedeem(player);
|
attemptRedeem(player);
|
||||||
|
@ -7,10 +7,10 @@ import mineplex.core.common.util.F;
|
|||||||
*/
|
*/
|
||||||
public enum ResponseType
|
public enum ResponseType
|
||||||
{
|
{
|
||||||
COUNTED(F.main("Carl", "Rewarded " + F.elem("1 Carl Spin Ticket") + " for watching the Ad! %elem% tickets remaining for the current 24 hour period!")),
|
COUNTED(F.main("Carl", "Rewarded " + F.elem("1 Carl Spin Ticket") + " for watching the Ad! " + F.elem("%elem%") + " tickets remaining for the current 24 hour period!")),
|
||||||
UNCOUNTED(F.main("Carl", "You already received your 5 " + F.elem("Carl Spin Tickets") + " for the current 24 hours! Your available tickets will refresh in %elem%!")),
|
UNCOUNTED(F.main("Carl", "You already received your " + F.elem("5 Carl Spin Tickets") + " for the current 24 hour period! Your available tickets will refresh in " + F.elem("%elem%") + "!")),
|
||||||
BLOCKED(F.main("Carl", "You have an AdBlocker on, but tried to watch the Ad! Ssssssslight problem there!")),
|
BLOCKED(F.main("Carl", "You have an AdBlocker on, but tried to watch the Ad! Ssssssslight problem there!")),
|
||||||
UNFILLED(F.main("Carl", "Ssssomething went wrong with the Ad, we'll get it sorted ASAP.")),;
|
UNFILLED(F.main("Carl", "Ssssomething went wrong with the Ad, we'll get it ssssorted ASAP. Try again in a few minutessss!")),;
|
||||||
|
|
||||||
private String _message;
|
private String _message;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user