remove some leftovers

This commit is contained in:
Lulu13022002 2024-10-29 15:33:42 +01:00
parent 40211a0ba0
commit 49eae0d5fb
No known key found for this signature in database
GPG Key ID: 491C8F0B8ACDEB01
3 changed files with 8 additions and 7 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Improve entity effect API
diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java
index 5341957b10cccd7bce5a7595699b1d90412a01d0..912dafd5a8884d7973b2126f97ecdbe54e78937f 100644 index 5341957b10cccd7bce5a7595699b1d90412a01d0..ef0acab253db878f1edee51b585fd1b20ef9161d 100644
--- a/src/main/java/org/bukkit/EntityEffect.java --- a/src/main/java/org/bukkit/EntityEffect.java
+++ b/src/main/java/org/bukkit/EntityEffect.java +++ b/src/main/java/org/bukkit/EntityEffect.java
@@ -112,11 +112,25 @@ public enum EntityEffect { @@ -112,11 +112,25 @@ public enum EntityEffect {
@ -76,7 +76,7 @@ index 5341957b10cccd7bce5a7595699b1d90412a01d0..912dafd5a8884d7973b2126f97ecdbe5
HURT_BERRY_BUSH(44, LivingEntity.class), HURT_BERRY_BUSH(44, LivingEntity.class),
/** /**
* Fox chews the food in its mouth * Fox chews the food in its mouth
@@ -331,7 +355,24 @@ public enum EntityEffect { @@ -331,7 +355,25 @@ public enum EntityEffect {
* Sniffer must have a target and be in {@link Sniffer.State#SEARCHING} or * Sniffer must have a target and be in {@link Sniffer.State#SEARCHING} or
* {@link Sniffer.State#DIGGING} * {@link Sniffer.State#DIGGING}
*/ */
@ -97,6 +97,7 @@ index 5341957b10cccd7bce5a7595699b1d90412a01d0..912dafd5a8884d7973b2126f97ecdbe5
+ * creaking heart. + * creaking heart.
+ */ + */
+ @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ SHAKE(66, org.bukkit.entity.CreakingTransient.class); + SHAKE(66, org.bukkit.entity.CreakingTransient.class);
+ // Paper end - add missing EntityEffect + // Paper end - add missing EntityEffect

View File

@ -45,7 +45,7 @@ index 39c96f5db6e90a470404c6387fa0c1d5531822e5..8aae1d113e84dfad9f2b6f0bcd203ca6
idispensebehavior.dispense(sourceblock, eventStack); idispensebehavior.dispense(sourceblock, eventStack);
} else { } else {
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 18304349c9ab24657c4152aff800dba969174665..94b2647f69035dce9a3d56b6978e3884e06c5583 100644 index 18304349c9ab24657c4152aff800dba969174665..681c38f4457fc10806c10518b16159580c0f2619 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -124,7 +124,7 @@ public interface DispenseItemBehavior { @@ -124,7 +124,7 @@ public interface DispenseItemBehavior {
@ -73,7 +73,7 @@ index 18304349c9ab24657c4152aff800dba969174665..94b2647f69035dce9a3d56b6978e3884
- DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
- if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) { - if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) {
+ DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior + DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior
+ if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE && idispensebehavior != this) { // Paper - fix possible StackOverflowError + if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != this) { // Paper - fix possible StackOverflowError
idispensebehavior.dispense(pointer, eventStack); idispensebehavior.dispense(pointer, eventStack);
return stack; return stack;
} }
@ -84,7 +84,7 @@ index 18304349c9ab24657c4152aff800dba969174665..94b2647f69035dce9a3d56b6978e3884
- DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
- if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) { - if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) {
+ DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior + DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior
+ if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE && idispensebehavior != this) { // Paper - fix possible StackOverflowError + if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != this) { // Paper - fix possible StackOverflowError
idispensebehavior.dispense(pointer, eventStack); idispensebehavior.dispense(pointer, eventStack);
return stack; return stack;
} }
@ -185,7 +185,7 @@ index 18304349c9ab24657c4152aff800dba969174665..94b2647f69035dce9a3d56b6978e3884
- DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
- if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) { - if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE) {
+ DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior + DispenseItemBehavior idispensebehavior = DispenserBlock.getDispenseBehavior(pointer, eventStack); // Paper - Fix NPE with equippable and items without behavior
+ if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != EquipmentDispenseItemBehavior.INSTANCE && idispensebehavior != this) { // Paper - fix possible StackOverflowError + if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != this) { // Paper - fix possible StackOverflowError
idispensebehavior.dispense(pointer, eventStack); idispensebehavior.dispense(pointer, eventStack);
return stack; return stack;
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Properly track the changed item from dispense events
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 94b2647f69035dce9a3d56b6978e3884e06c5583..a09b089565f9167e1a2d53116ae879d9f868342e 100644 index 681c38f4457fc10806c10518b16159580c0f2619..8f9b86e50717746e55232293d9e5ac05b8616aa0 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -129,10 +129,14 @@ public interface DispenseItemBehavior { @@ -129,10 +129,14 @@ public interface DispenseItemBehavior {