* Damage: 1 */ - DRYOUT + DRYOUT, + /** + * Damage caused from freezing. + *
+ * Damage: 1 or 5
+ */
+ FREEZE;
}
}
diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
index 16b5fd279b..b915c3cab1 100644
--- a/paper-api/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
+++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
@@ -170,6 +170,10 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
* attack (e.g. a cave spider or a shulker bullet).
*/
ATTACK,
+ /**
+ * When an entity gets the effect from an axolotl.
+ */
+ AXOLOTL,
/**
* When beacon effects get applied due to the entity being nearby.
*/
diff --git a/paper-api/src/main/java/org/bukkit/event/world/GenericGameEvent.java b/paper-api/src/main/java/org/bukkit/event/world/GenericGameEvent.java
new file mode 100644
index 0000000000..fed29b2cb2
--- /dev/null
+++ b/paper-api/src/main/java/org/bukkit/event/world/GenericGameEvent.java
@@ -0,0 +1,103 @@
+package org.bukkit.event.world;
+
+import com.google.common.base.Preconditions;
+import org.bukkit.GameEvent;
+import org.bukkit.Location;
+import org.bukkit.entity.Entity;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Represents a generic Mojang game event.
+ *
+ * Specific Bukkit events should be used where possible, this event is mainly
+ * used internally by Sculk sensors.
+ */
+public class GenericGameEvent extends WorldEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private final GameEvent event;
+ private final Location location;
+ private final Entity entity;
+ private int radius;
+ private boolean cancelled;
+
+ public GenericGameEvent(@NotNull GameEvent event, @NotNull Location location, @Nullable Entity entity, int radius) {
+ super(location.getWorld());
+ this.event = event;
+ this.location = location;
+ this.entity = entity;
+ }
+
+ /**
+ * Get the underlying event.
+ *
+ * @return the event
+ */
+ @NotNull
+ public GameEvent getEvent() {
+ return event;
+ }
+
+ /**
+ * Get the location where the event occurred.
+ *
+ * @return event location
+ */
+ @NotNull
+ public Location getLocation() {
+ return location;
+ }
+
+ /**
+ * Get the entity which triggered this event, if present.
+ *
+ * @return triggering entity or null
+ */
+ @Nullable
+ public Entity getEntity() {
+ return entity;
+ }
+
+ /**
+ * Get the block radius to which this event will be broadcast.
+ *
+ * @return broadcast radius
+ */
+ public int getRadius() {
+ return radius;
+ }
+
+ /**
+ * Set the radius to which the event should be broadcast.
+ *
+ * @param radius radius, must be greater than or equal to 0
+ */
+ public void setRadius(int radius) {
+ Preconditions.checkArgument(radius >= 0, "Radius must be >= 0");
+ this.radius = radius;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java b/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java
index 7caef27682..9d7592988a 100644
--- a/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java
+++ b/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java
@@ -231,6 +231,15 @@ public abstract class ChunkGenerator {
* Data for a Chunk.
*/
public static interface ChunkData {
+ /**
+ * Get the minimum height for the chunk.
+ *
+ * Setting blocks below this height will do nothing.
+ *
+ * @return the minimum height
+ */
+ public int getMinHeight();
+
/**
* Get the maximum height for the chunk.
*
@@ -246,7 +255,7 @@ public abstract class ChunkGenerator {
* Note: setting blocks outside the chunk's bounds does nothing.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @param material the type to set the block to
*/
@@ -258,7 +267,7 @@ public abstract class ChunkGenerator {
* Setting blocks outside the chunk's bounds does nothing.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @param material the type to set the block to
*/
@@ -270,7 +279,7 @@ public abstract class ChunkGenerator {
* Setting blocks outside the chunk's bounds does nothing.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @param blockData the type to set the block to
*/
@@ -330,7 +339,7 @@ public abstract class ChunkGenerator {
* Getting blocks outside the chunk's bounds returns air.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return the type of the block or Material.AIR if x, y or z are outside the chunk's bounds
*/
@@ -343,7 +352,7 @@ public abstract class ChunkGenerator {
* Getting blocks outside the chunk's bounds returns air.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return the type and data of the block or the MaterialData for air if x, y or z are outside the chunk's bounds
*/
@@ -356,7 +365,7 @@ public abstract class ChunkGenerator {
* Getting blocks outside the chunk's bounds returns air.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return the data of the block or the BlockData for air if x, y or z are outside the chunk's bounds
*/
@@ -369,7 +378,7 @@ public abstract class ChunkGenerator {
* Getting blocks outside the chunk's bounds returns 0.
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
+ * @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return the block data value or air if x, y or z are outside the chunk's bounds
* @deprecated Uses magic values
diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/BundleMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
new file mode 100644
index 0000000000..bc992fdf6d
--- /dev/null
+++ b/paper-api/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
@@ -0,0 +1,40 @@
+package org.bukkit.inventory.meta;
+
+import java.util.List;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface BundleMeta extends ItemMeta {
+
+ /**
+ * Returns whether the item has any items.
+ *
+ * @return whether items are present
+ */
+ boolean hasItems();
+
+ /**
+ * Returns an immutable list of the items stored in this item.
+ *
+ * @return items
+ */
+ @NotNull
+ List