[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002 2024-02-01 10:15:57 +01:00 committed by GitHub
commit 294347bee2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
295 changed files with 3245 additions and 3088 deletions

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..d78fe4081bc2938326066e0afddb4a6c833a4bf7 100644
index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..f9084e2605d7403721fe6b714bfad051f932aaef 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -328,7 +328,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@ -31,15 +31,15 @@ index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..d78fe4081bc2938326066e0afddb4a6c
return iblockdata;
} else {
int j = i + 1;
@@ -478,6 +492,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -477,6 +491,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
if (!itemstack.isEmpty()) {
this.changed = true;
BlockState iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack);
+ // Paper start - Add CompostItemEvent and EntityCompostItemEvent
+ if (iblockdata == null) {
+ return;
+ }
+ // Paper end - Add CompostItemEvent and EntityCompostItemEvent
this.level.levelEvent(1500, this.pos, iblockdata != this.state ? 1 : 0);
this.removeItemNoUpdate(0);
}