Yatopia/patches/api/0018-EMC-SnowmanThrowSnowballEvent.patch
2020-05-12 19:47:53 +02:00

83 lines
2.3 KiB
Diff

From 1b8ba0b95e9676bce55409a27118f962a7f8eeae Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 4 Dec 2016 20:28:24 -0500
Subject: [PATCH] EMC SnowmanThrowSnowballEvent
---
.../SnowmanThrowSnowballEvent.java | 63 +++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 src/main/java/com/empireminecraft/customevents/SnowmanThrowSnowballEvent.java
diff --git a/src/main/java/com/empireminecraft/customevents/SnowmanThrowSnowballEvent.java b/src/main/java/com/empireminecraft/customevents/SnowmanThrowSnowballEvent.java
new file mode 100644
index 000000000..53311062e
--- /dev/null
+++ b/src/main/java/com/empireminecraft/customevents/SnowmanThrowSnowballEvent.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
+ *
+ * This source code is proprietary software and must not be redistributed without Starlis LLC's approval
+ *
+ */
+
+package com.empireminecraft.customevents;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Snowball;
+import org.bukkit.entity.Snowman;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+
+public class SnowmanThrowSnowballEvent extends EntityEvent implements Cancellable {
+ private final Snowman snowman;
+ private final Snowball snowball;
+ private final LivingEntity target;
+
+ private static final HandlerList handlers = new HandlerList();
+
+ public SnowmanThrowSnowballEvent(Snowman snowman, Snowball snowball, LivingEntity target) {
+ super(snowman);
+ this.snowman = snowman;
+ this.snowball = snowball;
+ this.target = target;
+ }
+
+ public Snowman getSnowman() {
+ return snowman;
+ }
+
+ public Snowball getSnowball() {
+ return snowball;
+ }
+
+ public LivingEntity getTarget() {
+ return target;
+ }
+
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ private boolean cancelled = false;
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ }
+
+}
--
2.25.1.windows.1