mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
80 lines
2.2 KiB
Diff
80 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Mon, 21 Nov 2016 17:02:11 -0500
|
|
Subject: [PATCH] EMC - MonsterEggSpawnEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..8f1c9c421aeeb0ddf331f076a9b646c510ea4337
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
|
|
@@ -0,0 +1,67 @@
|
|
+package net.pl3x.purpur.event.entity;
|
|
+
|
|
+import org.bukkit.entity.Entity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+import org.bukkit.entity.Player;
|
|
+import org.bukkit.event.Cancellable;
|
|
+import org.bukkit.event.Event;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.inventory.ItemStack;
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+import org.jetbrains.annotations.Nullable;
|
|
+
|
|
+public class MonsterEggSpawnEvent extends Event implements Cancellable {
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private boolean canceled;
|
|
+
|
|
+ private final Player player;
|
|
+ private Entity entity;
|
|
+ private final ItemStack item;
|
|
+
|
|
+ public MonsterEggSpawnEvent(@Nullable HumanEntity player, @NotNull Entity entity, @NotNull ItemStack item) {
|
|
+ this.player = (Player) player;
|
|
+ this.entity = entity;
|
|
+ this.item = item;
|
|
+ }
|
|
+
|
|
+ @Nullable
|
|
+ public Player getPlayer() {
|
|
+ return player;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public Entity getEntity() {
|
|
+ return entity;
|
|
+ }
|
|
+
|
|
+ public void setEntity(@Nullable Entity entity) {
|
|
+ if (entity == null) {
|
|
+ canceled = true;
|
|
+ return;
|
|
+ }
|
|
+ this.entity = entity;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public ItemStack getItem() {
|
|
+ return item;
|
|
+ }
|
|
+
|
|
+ public boolean isCancelled() {
|
|
+ return canceled;
|
|
+ }
|
|
+
|
|
+ public void setCancelled(boolean cancel) {
|
|
+ canceled = cancel;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|