Skip to content

Commit

Permalink
Support triggering ACHIEVEMENT_PAGE for the page the achievement is on
Browse files Browse the repository at this point in the history
MY HEAD
  • Loading branch information
tterrag1098 committed Mar 29, 2016
1 parent 475c55f commit 7f77a60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -8,4 +8,4 @@ endercore_version=1.7.10-0.2.0.32_beta
dc_version=MC1.7.10-0.1.0-2

curse_projectId=231056
release_type=alpha
release_type=beta
Expand Up @@ -139,7 +139,7 @@ public boolean matchesObject(Object test, Object... in)
StatisticsFile file = ((EntityPlayerMP) in[1]).func_147099_x();
for (Achievement a : page.getAchievements())
{
if (!file.hasAchievementUnlocked(a) && a != in[2])
if (!file.hasAchievementUnlocked(a) && a != in[2] && !(a instanceof Ach) && (((Ach)a).parent.achievementSource != this || !((Ach)a).parent.required.equals(page.getName())))
{
return false;
}
Expand Down Expand Up @@ -183,6 +183,17 @@ public static String format(String s, AchievementData data) {
;
}
}

private class Ach extends Achievement
{
private AchievementType parent;

public Ach(String p_i45302_1_, String p_i45302_2_, int p_i45302_3_, int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_)
{
super(p_i45302_1_, p_i45302_2_, p_i45302_3_, p_i45302_4_, p_i45302_5_, p_i45302_6_);
parent = AchievementType.this;
}
}

/* JSON Fields @formatter:off */
public int x = 0;
Expand Down Expand Up @@ -228,7 +239,7 @@ public void register()
displayItem = required;
}

achievement = new Achievement(name, name, x, y, ItemUtil.parseStringIntoItemStack(displayItem), parentAchievement);
achievement = new Ach(name, name, x, y, ItemUtil.parseStringIntoItemStack(displayItem), parentAchievement);

if (parentAchievement == null)
{
Expand Down

0 comments on commit 7f77a60

Please sign in to comment.