From 87bcdae618d430c8dc4ce5167a3f723fa9a4d6f6 Mon Sep 17 00:00:00 2001 From: "yrsegal@gmail.com" Date: Sun, 6 Nov 2022 20:35:44 -0500 Subject: [PATCH] remove legacy migrator for colorizers --- .../hexcasting/api/misc/FrozenColorizer.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/misc/FrozenColorizer.java b/Common/src/main/java/at/petrak/hexcasting/api/misc/FrozenColorizer.java index 679948c5..ce2603f9 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/misc/FrozenColorizer.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/misc/FrozenColorizer.java @@ -1,26 +1,17 @@ package at.petrak.hexcasting.api.misc; import at.petrak.hexcasting.api.addldata.ADColorizer; -import at.petrak.hexcasting.common.items.colorizer.ItemPrideColorizer; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.xplat.IXplatAbstractions; import net.minecraft.Util; -import net.minecraft.core.Registry; import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; import net.minecraft.util.FastColor; import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.Vec3; -import java.util.Arrays; -import java.util.Map; import java.util.UUID; import java.util.function.Supplier; -import java.util.stream.Collectors; - -import static at.petrak.hexcasting.api.HexAPI.modLoc; /** * A colorizer item and the player who owned it at the time of making the color. @@ -31,12 +22,6 @@ public record FrozenColorizer(ItemStack item, UUID owner) { 0xFF200000, 0xFF202000, 0xFF002000, 0xFF002020, 0xFF000020, 0xFF200020 }; - private static final Map> OLD_PRIDE_COLORIZERS = Arrays.stream( - ItemPrideColorizer.Type.values()) - .collect(Collectors.>toMap( - (type) -> modLoc("pride_colorizer_" + type.ordinal()).toString(), - (type) -> (() -> HexItems.PRIDE_COLORIZERS.get(type)))); - public static final String TAG_STACK = "stack"; public static final String TAG_OWNER = "owner"; @@ -56,12 +41,6 @@ public record FrozenColorizer(ItemStack item, UUID owner) { } try { CompoundTag stackTag = tag.getCompound(TAG_STACK); - if (stackTag.contains("id", Tag.TAG_STRING)) { - String id = stackTag.getString("id"); - if (OLD_PRIDE_COLORIZERS.containsKey(id)) { - stackTag.putString("id", Registry.ITEM.getKey(OLD_PRIDE_COLORIZERS.get(id).get()).toString()); - } - } var stack = ItemStack.of(stackTag); var uuid = tag.getUUID(TAG_OWNER); return new FrozenColorizer(stack, uuid);