hey, look ma, am doing my part!
This commit is contained in:
parent
1d74ffcb7c
commit
6ac2614a5f
16 changed files with 281 additions and 353 deletions
79
patches/api/0186-PlayerDeathEvent-shouldDropExperience.patch
Normal file
79
patches/api/0186-PlayerDeathEvent-shouldDropExperience.patch
Normal file
|
@ -0,0 +1,79 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Tue, 24 Dec 2019 00:35:31 +0000
|
||||
Subject: [PATCH] PlayerDeathEvent#shouldDropExperience
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
index 61d12cb8f0a924abf696b6da7258f34dbb7b51b6..8175e5329f7fb6da4c7faf695162b51492114dc3 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import java.util.List;
|
||||
+
|
||||
+import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -18,6 +20,8 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
private boolean keepLevel = false;
|
||||
private boolean keepInventory = false;
|
||||
// Paper start
|
||||
+ private boolean doExpDrop;
|
||||
+
|
||||
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, @Nullable final net.kyori.adventure.text.Component adventure$deathMessage) {
|
||||
this(player, drops, droppedExp, 0, adventure$deathMessage, null);
|
||||
}
|
||||
@@ -27,12 +31,17 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
}
|
||||
|
||||
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final net.kyori.adventure.text.Component adventure$deathMessage, @Nullable String deathMessage) {
|
||||
+ this(player, drops, droppedExp, newExp, newTotalExp, newLevel, adventure$deathMessage, deathMessage, true);
|
||||
+ }
|
||||
+
|
||||
+ public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final net.kyori.adventure.text.Component adventure$deathMessage, @Nullable String deathMessage, boolean doExpDrop) {
|
||||
super(player, drops, droppedExp);
|
||||
this.newExp = newExp;
|
||||
this.newTotalExp = newTotalExp;
|
||||
this.newLevel = newLevel;
|
||||
this.deathMessage = deathMessage;
|
||||
this.adventure$deathMessage = adventure$deathMessage;
|
||||
+ this.doExpDrop = doExpDrop;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -47,6 +56,11 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
|
||||
@Deprecated // Paper
|
||||
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final String deathMessage) {
|
||||
+ this(player, drops, droppedExp, newExp, newTotalExp, newLevel, deathMessage, true);
|
||||
+ }
|
||||
+
|
||||
+ @Deprecated // Paper
|
||||
+ public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final String deathMessage, boolean doExpDrop) {
|
||||
super(player, drops, droppedExp);
|
||||
this.newExp = newExp;
|
||||
this.newTotalExp = newTotalExp;
|
||||
@@ -88,6 +102,20 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
public List<ItemStack> getItemsToKeep() {
|
||||
return itemsToKeep;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * @return should experience be dropped from this death
|
||||
+ */
|
||||
+ public boolean shouldDropExperience() {
|
||||
+ return doExpDrop;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @param doExpDrop sets if experience should be dropped from this death
|
||||
+ */
|
||||
+ public void setShouldDropExperience(boolean doExpDrop) {
|
||||
+ this.doExpDrop = doExpDrop;
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
@NotNull
|
37
patches/api/0187-Add-effect-to-block-break-naturally.patch
Normal file
37
patches/api/0187-Add-effect-to-block-break-naturally.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 2 Jan 2020 12:25:16 -0600
|
||||
Subject: [PATCH] Add effect to block break naturally
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 5e92f8f6ba5368ae934c24154ab13fbc6a46272f..20463f92d83dea3130d4a3f0ac70e5f399c97711 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -470,6 +470,26 @@ public interface Block extends Metadatable {
|
||||
*/
|
||||
boolean breakNaturally(@Nullable ItemStack tool);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Breaks the block and spawns item drops as if a player had broken it
|
||||
+ *
|
||||
+ * @param triggerEffect Play the block break particle effect and sound
|
||||
+ * @return true if the block was destroyed
|
||||
+ */
|
||||
+ boolean breakNaturally(boolean triggerEffect);
|
||||
+
|
||||
+ /**
|
||||
+ * Breaks the block and spawns item drops as if a player had broken it
|
||||
+ * with a specific tool
|
||||
+ *
|
||||
+ * @param tool The tool or item in hand used for digging
|
||||
+ * @param triggerEffect Play the block break particle effect and sound
|
||||
+ * @return true if the block was destroyed
|
||||
+ */
|
||||
+ boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Simulate bone meal application to this block (if possible).
|
||||
*
|
Loading…
Add table
Add a link
Reference in a new issue