From eb1b19d979f55bf690d8336c8d97813eb69fa196 Mon Sep 17 00:00:00 2001 From: WinX64 Date: Tue, 26 May 2020 19:34:39 +1000 Subject: [PATCH] SPIGOT-5748: Add instant effect potion break to the Effect enum Conversion from Color to integer for the data of the new enum entry --- src/main/java/org/bukkit/craftbukkit/CraftEffect.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java index a06741a783..bc653300ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit; import net.minecraft.server.Block; import net.minecraft.server.Item; import org.apache.commons.lang.Validate; +import org.bukkit.Color; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.BlockFace; @@ -19,6 +20,9 @@ public class CraftEffect { case POTION_BREAK: datavalue = ((Potion) data).toDamageValue() & 0x3F; break; + case INSTANT_POTION_BREAK: + datavalue = ((Color) data).asRGB(); + break; case RECORD_PLAY: Validate.isTrue(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type!"); datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data));