-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 1.5.0 #370
base: master
Are you sure you want to change the base?
Release 1.5.0 #370
Conversation
Update en-US.yml
Reduce code duplication by abstracting classes
This enables things like a challenge to kill 10 creepers, 10 zombies, and 10 skeletons.
Enable challenges to have multiple statistic requirements
Better icons for entities
public StatisticRequirements() | ||
{ | ||
// Empty constructor | ||
public record StatisticRec(@Expose Statistic statistic, @Expose EntityType entity, @Expose Material material, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new record that contains all the data for a Statistic challenge.
// Section: Getters and setters | ||
// --------------------------------------------------------------------- | ||
|
||
@Expose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entry is not removed to keep backward compatibility, however, it is never read directly by the code and instead is used when requesting the List of statistics.
{ | ||
return material; | ||
} | ||
private List<StatisticRec> statisticList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new Statistics list.
*/ | ||
public int getAmount() | ||
@Override | ||
public Requirements copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy is easier.
{ | ||
this.amount = amount; | ||
// TODO - do something here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BONNe I'm not sure what this is for. It used to be some self-check code. Is it required still?
public List<StatisticRec> getRequiredStatistics() { | ||
if (statisticList == null) { | ||
statisticList = new ArrayList<>(); | ||
// Convert old single statistic entries to new list of records |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backwards compatibility
"[warning-block]", warningBlocks, "[warning-entity]", warningEntities, "[search-radius]", searchRadius); | ||
} | ||
|
||
private String getBlocksTagsDescription(IslandRequirements requirement, String reference) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add description for Block Tags AKA Block Groups
return tags; | ||
} | ||
|
||
private String getEntityTypeTagsDescription(IslandRequirements requirement, String reference) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entity Tags description
* Stores filtered items. | ||
*/ | ||
private List<EntityType> filterElements; | ||
public class MultiEntitySelector extends UnifiedMultiSelector<EntityType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more abstraction to reduce code duplication
return true; | ||
}). | ||
build(); | ||
icon(ManageStatisticsPanel.getStatisticIcon(statistic)).description(description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Statistic icons instead of just paper.
case STATISTIC_TYPE -> { | ||
StatisticRequirements requirements = this.challenge.getRequirements(); | ||
} | ||
case STATISTIC_TYPE -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main change in this class is here where multiple stats are checked instead of just the one.
private Map<Material, Integer> requiredBlocks = new EnumMap<>(Material.class); | ||
|
||
@Expose | ||
private Map<Tag<Material>, Integer> requiredMaterialTags = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New block tags added
@Expose | ||
private Map<Tag<Material>, Integer> requiredMaterialTags = new HashMap<>(); | ||
@Expose | ||
private Map<Tag<Fluid>, Integer> requiredFluidTags = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New fluid tag map added, but this is not used right now. Could be used in the future maybe.
private Map<Tag<Material>, Integer> requiredMaterialTags = new HashMap<>(); | ||
@Expose | ||
private Map<Tag<Fluid>, Integer> requiredFluidTags = new HashMap<>(); | ||
@Expose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entity group map added
* Stores filtered items. | ||
*/ | ||
private List<Material> filterElements; | ||
public class MultiBlockSelector extends UnifiedMultiSelector<Material> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shrunk down by using Abstract class to reduce code duplication.
* @param et entity type | ||
* @return ItemStack | ||
*/ | ||
public static ItemStack getIcon(EntityType et) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small method for entity icons. A big better than just eggs.
Hi @BONNe - this is just FYI - I am sure you are busy. Please feel free to try the SNAPSHOT. I am working on a couple of other additions, but I'd like to get this one out soon. I made the changes to support some of the challenges I want for Poseidon. I plan to put the Poseidon challenges on the web so they can be downloaded too. |
Enables per-player permission waivers.
Add permission [gamemode].challenges.waiver-add.x to addon
The admin may want to hide the rewards and just use the reward description. If the number of rewards is very long, it can be a problem to list them all.
Add switch to hide reward items from the GUI list.
Added a PAPI formula option to Other challenge types.
|
This PR introduces improvements related to challenge tracking and completion logic, adding the ability to set up Island Range challenges that will complete based on block groups, e.g., 20 of any coral, entity groups, e.g., all undead, or challenges that have multiple statistics, e.g., kill 10 skeletons and kill 10 creepers.
Key Updates
Other Updates
Statistic Challenges
More than one statistic can be required to complete a challenge. If more than one is set, all statistics have to be met in order for the challenge to be completed.
Block Groups and Entity Groups
For Island Challenges, these can be used. This allows challenges to be less specific and more general.