package net.minecraft.client.renderer; import java.util.function.Function; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.world.level.block.state.properties.ChestType; @Environment(EnvType.CLIENT) public record MultiblockChestResources(T single, T left, T right) { public T select(final ChestType chestType) { return (T)(switch (chestType) { case SINGLE -> this.single; case LEFT -> this.left; case RIGHT -> this.right; }); } public MultiblockChestResources map(final Function mapper) { return (MultiblockChestResources)(new MultiblockChestResources<>(mapper.apply(this.single), mapper.apply(this.left), mapper.apply(this.right))); } }