aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-08-25 14:51:42 -0700
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-08-25 14:51:42 -0700
commitfca13e61adcfbdbf38497c20a2e41ef120ef1d13 (patch)
tree2fcf430a4de62639338bf9b360853bb46c5b9d90 /src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
downloadIceberg-fca13e61adcfbdbf38497c20a2e41ef120ef1d13.tar.gz
Iceberg-fca13e61adcfbdbf38497c20a2e41ef120ef1d13.tar.bz2
Iceberg-fca13e61adcfbdbf38497c20a2e41ef120ef1d13.zip
Initial commit.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
new file mode 100644
index 0000000..8148b9b
--- /dev/null
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
@@ -0,0 +1,38 @@
+package com.anthonyhilyard.iceberg.events;
+
+import net.minecraftforge.event.entity.player.AdvancementEvent;
+import net.minecraft.advancements.Advancement;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraftforge.common.MinecraftForge;
+
+/**
+ * This event is fired when a player is granted an advancement criterion.
+ * <br>
+ * This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
+ * <br>
+ * This event does not have a result. {@link HasResult}<br>
+ * <br>
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ */
+public class CriterionEvent extends AdvancementEvent
+{
+ private final Advancement advancement;
+ private final String criterionKey;
+
+ public CriterionEvent(PlayerEntity player, Advancement advancement, String criterionKey)
+ {
+ super(player, advancement);
+ this.advancement = advancement;
+ this.criterionKey = criterionKey;
+ }
+
+ public Advancement getAdvancement()
+ {
+ return advancement;
+ }
+
+ public String getCriterionKey()
+ {
+ return criterionKey;
+ }
+}