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;
|
||||
|
||||
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.gui.GuiItem;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.playwire.PlayWireManager;
|
||||
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!")
|
||||
.addLore(
|
||||
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.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)
|
||||
.setTitle(C.cGreen + C.Bold + "Watch an Ad!")
|
||||
.addLore(
|
||||
C.cYellow + "Earn a 100 Shard Reward",
|
||||
C.cYellow + "and 1 Carl Spin Ticket",
|
||||
C.cYellow + "Earn 1 Carl Spin Ticket",
|
||||
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.cRedB + "Be sure to have your AdBlocker disabled!",
|
||||
|
@ -87,8 +87,8 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
|
||||
public boolean canRedeemTickets(PlayWireClientData data)
|
||||
{
|
||||
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)
|
||||
@ -166,6 +166,11 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
|
||||
getPlugin().getLogger().severe("PLAY WIRE PLAYER NOT FOUND ERROR: PlayerName: " + target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (response == ResponseType.UNCOUNTED)
|
||||
{
|
||||
response = ResponseType.UNFILLED;
|
||||
}
|
||||
|
||||
if (response == ResponseType.COUNTED)
|
||||
{
|
||||
|
@ -7,10 +7,10 @@ import mineplex.core.common.util.F;
|
||||
*/
|
||||
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!")),
|
||||
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%!")),
|
||||
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 " + 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!")),
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user