Skip to content

Commit 2b2cadd

Browse files
committed
Revert Keys.COLOR supports removal in 59f1841
1 parent 468c92b commit 2b2cadd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/spongepowered/common/data/provider/item/stack/PotionItemStackData.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import net.minecraft.core.registries.BuiltInRegistries;
3131
import net.minecraft.world.effect.MobEffectInstance;
3232
import net.minecraft.world.item.ItemStack;
33+
import net.minecraft.world.item.Items;
3334
import net.minecraft.world.item.alchemy.Potion;
3435
import net.minecraft.world.item.alchemy.PotionContents;
3536
import org.spongepowered.api.data.Keys;
@@ -57,6 +58,7 @@ public static void register(final DataProviderRegistrator registrator) {
5758
.get(h -> Color.ofRgb(h.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).getColor()))
5859
.set((h, v) -> h.update(DataComponents.POTION_CONTENTS, PotionContents.EMPTY, contents -> new PotionContents(contents.potion(), Optional.of(v.rgb()), contents.customEffects(), contents.customName())))
5960
.delete(h -> h.update(DataComponents.POTION_CONTENTS, PotionContents.EMPTY, contents -> new PotionContents(contents.potion(), Optional.empty(), contents.customEffects(), contents.customName())))
61+
.supports(h -> h.getItem() == Items.POTION || h.getItem() == Items.SPLASH_POTION || h.getItem() == Items.LINGERING_POTION || h.getItem() == Items.TIPPED_ARROW)
6062
.create(Keys.CUSTOM_POTION_EFFECTS)
6163
.get(h -> {
6264
final List<MobEffectInstance> effects = h.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).customEffects();

0 commit comments

Comments
 (0)