Update CraftBukkit to Minecraft 1.7.5

This commit is contained in:
Nate Mortensen authored and EvilSeph committed 2014-03-21 23:56:34 -04:00
1 parent afb3511a4a
commit 385ace970e
206 files changed
+2670 -2679

No files matched your search

@@ -1,17 +1,18 @@
package net.minecraft.server;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.util.com.google.common.collect.Maps;
public class StatisticManager {
protected final Map a = new HashMap();
protected final Map a = Maps.newConcurrentMap();
public StatisticManager() {
}
public boolean a(Achievement achievement) {
return this.a((Statistic) achievement) > 0;
return this.getStatisticValue((Statistic) achievement) > 0;
}
public boolean b(Achievement achievement) {
@@ -20,17 +21,17 @@ public class StatisticManager {
public void b(EntityHuman entityhuman, Statistic statistic, int i) {
if (!statistic.d() || this.b((Achievement) statistic)) {
// CraftBukkit start
org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, a(statistic), i);
// CraftBukkit start - fire Statistic events
org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, this.getStatisticValue(statistic), i);
if (cancellable != null && cancellable.isCancelled()) {
return;
}
// CraftBukkit end
this.a(entityhuman, statistic, this.a(statistic) + i);
this.setStatistic(entityhuman, statistic, this.getStatisticValue(statistic) + i);
}
}
public void a(EntityHuman entityhuman, Statistic statistic, int i) {
public void setStatistic(EntityHuman entityhuman, Statistic statistic, int i) {
StatisticWrapper statisticwrapper = (StatisticWrapper) this.a.get(statistic);
if (statisticwrapper == null) {
@@ -41,7 +42,7 @@ public class StatisticManager {
statisticwrapper.a(i);
}
public int a(Statistic statistic) {
public int getStatisticValue(Statistic statistic) {
StatisticWrapper statisticwrapper = (StatisticWrapper) this.a.get(statistic);
return statisticwrapper == null ? 0 : statisticwrapper.a();