mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-12-30 21:07:47 +01:00
parent
644c7d6ba5
commit
1b01995546
@ -190,6 +190,12 @@ public class Challenge implements DataObject
|
|||||||
@Expose
|
@Expose
|
||||||
private boolean repeatable;
|
private boolean repeatable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Timeout for repeatable challenge before it can be completed again.
|
||||||
|
*/
|
||||||
|
@Expose
|
||||||
|
private long timeout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of the repeat rewards. If blank, it will be autogenerated
|
* Description of the repeat rewards. If blank, it will be autogenerated
|
||||||
*/
|
*/
|
||||||
@ -442,6 +448,17 @@ public class Challenge implements DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets timeout.
|
||||||
|
*
|
||||||
|
* @return the timeout
|
||||||
|
*/
|
||||||
|
public long getTimeout()
|
||||||
|
{
|
||||||
|
return timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
// Section: Setters
|
// Section: Setters
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
@ -698,6 +715,17 @@ public class Challenge implements DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets timeout.
|
||||||
|
*
|
||||||
|
* @param timeout the timeout
|
||||||
|
*/
|
||||||
|
public void setTimeout(long timeout)
|
||||||
|
{
|
||||||
|
this.timeout = timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
// Section: Other methods
|
// Section: Other methods
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
@ -715,7 +743,7 @@ public class Challenge implements DataObject
|
|||||||
public boolean matchGameMode(String gameMode)
|
public boolean matchGameMode(String gameMode)
|
||||||
{
|
{
|
||||||
return gameMode != null &&
|
return gameMode != null &&
|
||||||
this.uniqueId.regionMatches(true, 0, gameMode, 0, gameMode.length());
|
this.uniqueId.regionMatches(true, 0, gameMode, 0, gameMode.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -746,13 +774,11 @@ public class Challenge implements DataObject
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(obj instanceof Challenge))
|
if (!(obj instanceof Challenge other))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Challenge other = (Challenge) obj;
|
|
||||||
|
|
||||||
if (uniqueId == null)
|
if (uniqueId == null)
|
||||||
{
|
{
|
||||||
return other.uniqueId == null;
|
return other.uniqueId == null;
|
||||||
@ -831,6 +857,7 @@ public class Challenge implements DataObject
|
|||||||
collect(Collectors.toCollection(() -> new ArrayList<>(this.repeatItemReward.size()))));
|
collect(Collectors.toCollection(() -> new ArrayList<>(this.repeatItemReward.size()))));
|
||||||
clone.setRepeatMoneyReward(this.repeatMoneyReward);
|
clone.setRepeatMoneyReward(this.repeatMoneyReward);
|
||||||
clone.setRepeatRewardCommands(new ArrayList<>(this.repeatRewardCommands));
|
clone.setRepeatRewardCommands(new ArrayList<>(this.repeatRewardCommands));
|
||||||
|
clone.setTimeout(this.timeout);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user