3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

SPIGOT-5748: Add instant effect potion break to the Effect enum

Conversion from Color to integer for the data of the new enum entry
Dieser Commit ist enthalten in:
WinX64 2020-05-26 19:34:39 +10:00 committet von md_5
Ursprung d07a78b1f3
Commit eb1b19d979

Datei anzeigen

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit;
import net.minecraft.server.Block; import net.minecraft.server.Block;
import net.minecraft.server.Item; import net.minecraft.server.Item;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Color;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -19,6 +20,9 @@ public class CraftEffect {
case POTION_BREAK: case POTION_BREAK:
datavalue = ((Potion) data).toDamageValue() & 0x3F; datavalue = ((Potion) data).toDamageValue() & 0x3F;
break; break;
case INSTANT_POTION_BREAK:
datavalue = ((Color) data).asRGB();
break;
case RECORD_PLAY: case RECORD_PLAY:
Validate.isTrue(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type!"); Validate.isTrue(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type!");
datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data)); datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data));