Skip to content

Commit

Permalink
Add OMINOUS_ITEM_SPAWNER SpawnReason
Browse files Browse the repository at this point in the history
  • Loading branch information
dawon committed Jul 12, 2024
1 parent 70ff1ec commit d999d0b
Show file tree
Hide file tree
Showing 103 changed files with 38 additions and 2 deletions.
23 changes: 23 additions & 0 deletions patches/api/0380-Fixes-and-additions-to-the-SpawnReason-API.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jakub Zacek <dawon@dawon.eu>
Date: Mon, 17 Jun 2024 19:07:00 +0200
Subject: [PATCH] Fixes and additions to the SpawnReason API


diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 15cb5ea4b68eca070f73d2b899543274415ad240..2de81ee445824562aec7b52b7369b75280aab959 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -206,6 +206,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
* When a creature is spawned by an enchantment
*/
ENCHANTMENT,
+ // Paper start - Fixes and additions to the SpawnReason API
+ /**
+ * When an entity spawns from an ominous item spawner
+ */
+ OMINOUS_ITEM_SPAWNER,
+ // Paper end - Fixes and additions to the SpawnReason API
/**
* When a creature is spawned by plugins
*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ index 69a661f01e43d17262fd2845dde5528416bbe456..c0062c8f83641ff30e79a309c0bb9930
}

@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/OminousItemSpawner.java b/src/main/java/net/minecraft/world/entity/OminousItemSpawner.java
index 146cbec9e64b6c77759aadd0d0c4e989018e9aef..4c4545b3732d4c08afdb7bc1913169a96e82825c 100644
--- a/src/main/java/net/minecraft/world/entity/OminousItemSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/OminousItemSpawner.java
@@ -89,7 +89,7 @@ public class OminousItemSpawner extends Entity {
entity = new ItemEntity(level, this.getX(), this.getY(), this.getZ(), itemStack);
}

- level.addFreshEntity(entity);
+ level.addFreshEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.OMINOUS_ITEM_SPAWNER); // Paper - Fixes and additions to the SpawnReason API
level.levelEvent(3021, this.blockPosition(), 1);
level.gameEvent(entity, GameEvent.ENTITY_PLACE, this.position());
this.setItem(ItemStack.EMPTY);
diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
index 1dade7a4fbdf190661e4431496349444467509cc..3e869620db35d38db39fbeed715b898ef9d2743c 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0991-Moonrise-optimisation-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31999,10 +31999,10 @@ index a0ae26d6197e1069ca09982b4f8b706c55ae8491..1a4dc4b2561dbaf01246b4fb46266b1a
ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create);

diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 45704653310efe9cb755a644674b54b8722c2c84..2ff21c5a9f7bcecb57ffaaafecc1462ca5456e48 100644
index d775ab8b0d37797f29e650842191d40691fb7afc..a7108b2be0746aa1f0e574d8c6f5ffad6d369835 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -279,7 +279,7 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -280,7 +280,7 @@ public class Block extends BlockBehaviour implements ItemLike {
}

public static boolean isShapeFullBlock(VoxelShape shape) {
Expand Down

0 comments on commit d999d0b

Please sign in to comment.